question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should PUT create the resource if it doesn't exist ?

See original GitHub issue

Step to reproduce

  • create a resource post in db.json
  • send the following request PUT /post
{
  "author": "someone",
  "content": "this project is awesome"
}

Actual Behaviour

The request fail and returns 404

Expected Behaviour

The resource is created and 201 is returned

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:5
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
florianwalther-privatecommented, Oct 11, 2018

Any updates for this?

6reactions
hereiscasiocommented, Sep 9, 2019

this should be a bug, now is 2019

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should HTTP PUT create a resource if it does not exist?
Usually, in a real REST scenario though, the client should use URI that are provided by the server and not just chose any...
Read more >
When to use PUT or POST in a RESTful Web Service? Answer
Btw, you are not alone, one of the most common confusion among web developers is the choice of PUT or POST HTTP method...
Read more >
REST Lazy Reference Create GET or POST?
GET should never create a resource. Not one that is visible to the user. It's a read-only operation. The standard for both POST...
Read more >
PUT - HTTP - MDN Web Docs
The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.
Read more >
How to Use Conditional Expressions to Create a Resource if it ...
We often get support requests for advice on how to create conditional resources. That is, how do I create a resource if it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found