# Like/Unlike a post returns 404

**URL:** https://meta.discourse.org/t/like-unlike-a-post-returns-404/128242
**Category:** Development
**Created:** [September 11, 2019, 7:15am UTC](https://meta.discourse.org/t/like-unlike-a-post-returns-404/128242 "2019-09-11T07:15:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Vishal\_Kaushik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vishal_kaushik/32/140452_2.png) [@Vishal\_Kaushik](https://meta.discourse.org/u/Vishal_Kaushik)
#### Post date: [September 11, 2019, 7:15am UTC](https://meta.discourse.org/t/like-unlike-a-post-returns-404/128242/1 "2019-09-11T07:15:17Z")

</div>

I am trying to like/unlike a post via API but it returns 404, “errors”:[“The requested URL or resource could not be found.”] and sometimes it executes successfully. What could be the possible reason for this?

---

<div class="post-metadata">

### Author: ![Vishal\_Kaushik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vishal_kaushik/32/140452_2.png) [@Vishal\_Kaushik](https://meta.discourse.org/u/Vishal_Kaushik)
#### Post date: [September 11, 2019, 7:52am UTC](https://meta.discourse.org/t/like-unlike-a-post-returns-404/128242/2 "2019-09-11T07:52:55Z")

</div>

I am making a HTTP call from Node.js with following data:

```
let form = {
    post_action_type_id: 2
};

```

and with following options :

```
{ hostname: 'comments.charmboard.com',
  path: '/post_actions/85815',
  method: 'DELETE',
  timeout: 3000,
  headers: 
   { 'Content-Type': 'application/x-www-form-urlencoded',
     'Content-Length': 21,
     Accept: 'application/json',
     'Api-Key': '12345678909876543212345678987654323456789',
     'Api-Username': '113225072183895994023' } }

```

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [September 11, 2019, 9:12am UTC](https://meta.discourse.org/t/like-unlike-a-post-returns-404/128242/3 "2019-09-11T09:12:58Z")

</div>

Did you tried the same by using Postman?

---

<div class="post-metadata">

### Author: ![Vishal\_Kaushik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vishal_kaushik/32/140452_2.png) [@Vishal\_Kaushik](https://meta.discourse.org/u/Vishal_Kaushik)
#### Post date: [September 11, 2019, 9:26am UTC](https://meta.discourse.org/t/like-unlike-a-post-returns-404/128242/4 "2019-09-11T09:26:59Z")

</div>

I think I got the issue. Somehow only unlike Post is being called from my code and that’s why its returning 404. Thanks for the reply @fzngagan.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [September 11, 2019, 9:58am UTC](https://meta.discourse.org/t/like-unlike-a-post-returns-404/128242/5 "2019-09-11T09:58:05Z")

</div>

Yes. Are you sending the request always using `DELETE` method?  
Its only for unliking. For liking, you need to send the request with `POST` method.
