typicode / jsonplaceholder

A simple online fake REST API server
https://jsonplaceholder.typicode.com
MIT License
5.05k stars 581 forks source link

Custom Status Code #167

Open gautambitious opened 3 years ago

gautambitious commented 3 years ago

Sometimes developers need to handle responses based on their status code. Can you add routes to return common status codes like 401, 404?

UmarBaraq commented 2 weeks ago

DummyJSON supports this: https://dummyjson.com/docs/http

fetch('https://dummyjson.com/http/404/Hello_Peter')
.then(res => res.json())
.then(console.log);