Giter Site home page Giter Site logo

Comments (4)

typicode avatar typicode commented on May 12, 2024

Hi Kokujin,

Do you have a README for RestClient? I don't know this tool.

Regarding the 500 error, I can give some explanations but not sure if that's what you're asking for.

Anyway, this is because JSONPlaceholder is mostly read-only. It just fakes resources creation and updates.

Here's how it works:

There are 100 posts in JSONPlaceholder.

You can POST to http://jsonplaceholder.typicode.com/posts, it will tell you it was created but in fact if you make a GET request to the same URL you'll still have 100 posts.

So when you try to update post 102, it doesn't exist (though I agree there could be a better status code than 500, I'll fix that when I have the time).

If the problem is that there's no post created, I'd suggest that you run JSON Server instead, it's read and write.

from json-server.

kokujin avatar kokujin commented on May 12, 2024

Thanks @typicode . I'll probably run my own server although I think the site and fake services great, its so bothersome when one wants to test a client quickly :)

https://github.com/jpillora/jquery.rest

from json-server.

typicode avatar typicode commented on May 12, 2024

Cool, I appreciate your feedback.
And I'll try to improve the returned status code :)

Thanks for the link.

from json-server.

typicode avatar typicode commented on May 12, 2024

JSON-Server v0.4.0 now returns 404 when trying access a resource that doesn't exist. Closing the issue here (jsonplaceholder will need to be updated though).

from json-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.