# DELETE is not functioning as expected

**URL:** <https://forum.codewithmosh.com/t/delete-is-not-functioning-as-expected/2517>\
**Category:** Angular\
**Created:** [February 8, 2021, 3:24am UTC](https://forum.codewithmosh.com/t/delete-is-not-functioning-as-expected/2517 "2021-02-08T03:24:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisUribe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/chrisuribe/32/62_2.png) [@ChrisUribe](https://forum.codewithmosh.com/u/ChrisUribe)\
**Post date:** [February 8, 2021, 3:24am UTC](https://forum.codewithmosh.com/t/delete-is-not-functioning-as-expected/2517/1 "2021-02-08T03:24:57Z")

</div>

A DELETE on

[http://jsonplaceholder.typicode.com/posts/10000000000](http://jsonplaceholder.typicode.com/posts/10000000000)

will return with a “STATUS: 200 OK” which is wrong.

If I try a DELETE on:

[https://my-json-server.typicode.com/typicode/demo/posts/100000000000](https://my-json-server.typicode.com/typicode/demo/posts/100000000000)

it returns with a “STATUS: 404 Not Found” which is correct.

I’m not sure how long the second URL will work. However, if you’re expecting the behavior in the video, you may be surprised. Keep in mind, the Angular function is working correctly. It’s just that for some reason the website mentioned in the video does not seem to respond the same way that it used to.

**Course:** Angular 4: Beginner to Pro  
**Section:** Consuming HTTP Services  
**Video:** [12- Handling Expected Errors](https://codewithmosh.com/courses/206545/lectures/3196486)

---

<div class="post-metadata">

**Author:** ![billraj10](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@billraj10](https://forum.codewithmosh.com/u/billraj10)\
**Post date:** [February 27, 2021, 1:09am UTC](https://forum.codewithmosh.com/t/delete-is-not-functioning-as-expected/2517/2 "2021-02-27T01:09:45Z")

</div>

Thanks. I had the same issue

---

<div class="post-metadata">

**Author:** ![hirun](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hirun](https://forum.codewithmosh.com/u/hirun)\
**Post date:** [January 13, 2023, 8:37pm UTC](https://forum.codewithmosh.com/t/delete-is-not-functioning-as-expected/2517/4 "2023-01-13T20:37:23Z")

</div>

use

> **[DummyJSON - Fake REST API of JSON data for development](https://dummyjson.com/)**
>
> Different types of REST Endpoints filled with JSON data to use in developing the frontend without worrying about writing a backend.

Fake restAPI instead of using jsonplaceholder  
and change the ngOnInit() as below,

ngOnInit(): void {  
this.service.getPosts()  
.subscribe((response : any) =\>{  
this.posts = response.posts;  
console.log(response)  
},  
);

}
