Questions tagged [put]

PUT is a HTTP method which requests that the enclosed entity be stored under the supplied URL.

PUT is a HTTP method which requests that the enclosed entity be stored under the supplied URL. If the URL refers to an already existing resource, the enclosed entity should be considered as a modified version of the one residing on the origin server. If the URL does not point to an existing resource, and that URL is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URL.

References- apache.org, w3.org

2236 questions
68
votes
11 answers

How do you do an HTTP Put?

We have this software that has a webservices component. Now, the administrator of this system has come to me, wanting to import data into the system by using the webservices component. So, I went to read the documentation to try to figure this thing…
Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346
65
votes
4 answers

PUT vs. POST for Uploading Files - RESTful API to be Built Using Zend Framework

I'm building a RESTful API using Zend Framework via the Zend_Rest_Route. For uploading of files, should I use PUT or POST to handle the process? I'm trying to be as consistent as possible with the definition of the REST verbs. Please refer to: PUT…
woran
  • 1,317
  • 2
  • 16
  • 22
65
votes
5 answers

Curl and PHP - how can I pass a json through curl by PUT,POST,GET

I have been working on building an Rest API for the hell of it and I have been testing it out as I go along by using curl from the command line which is very easy for CRUD I can successfully make these call from the command line curl -u…
Gilberg
  • 2,514
  • 4
  • 31
  • 41
65
votes
2 answers

How to specify python requests http put body?

I'm trying to rewrite some old python code with requests module. The purpose is to upload an attachment. The mail server requires the following specification…
omer bach
  • 2,345
  • 5
  • 30
  • 46
59
votes
15 answers

IIS 7.5 + enable PUT and DELETE for RESTFul service, extensionless

i am trying to understand how IIS 7.5 handles POST and PUT request. I am writing a RESTful service using OpenRasta framework. The POST operation works without any problem, but the PUT operation for the same URL does not. It returns error like the…
Eatdoku
  • 6,569
  • 13
  • 63
  • 98
56
votes
2 answers

Django Test Client Method Override Header

I am trying to test my update method on my viewset. The viewset is a modelviewset taken from drf. To update i would need to send a put request. As this is not always supported there are 2 ways to tell the server i am making a put request, the first…
Iwan1993
  • 1,669
  • 2
  • 17
  • 25
55
votes
3 answers

RESTful Soft Delete

I'm trying to build a RESTful webapp wherein I utilize GET, POST, PUT, and DELETE. But I had a question about the use of DELETE in this particular app. A bit of background first: My webapp manages generic entities that are also managed (and, it…
jamesplease
  • 12,547
  • 6
  • 47
  • 73
48
votes
8 answers

Laravel form html with PUT method for PUT routes

I Have this in my routes : +--------+---------------------------+--------------+--------------------------- …
48
votes
6 answers

Which REST operation (GET, PUT, or POST) for validating information?

My users enter a few information fields in an iOS app. This information must be validated on my server, which has a RESTful API. After validation the UI of the iOS app changes to indicate the result. Neither GET, PUT, or POST seem to be appropriate,…
meaning-matters
  • 21,929
  • 10
  • 82
  • 142
42
votes
4 answers

Error: C# The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

I'm trying to make a request via SSL. The certificate is already installed on the machine and it works via browser. I am using this request: System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); byte[] data =…
Roger G
  • 1,575
  • 2
  • 10
  • 9
42
votes
5 answers

REST - Shouldn't PUT = Create and POST = Update

Shouldn't PUT be used to Create and POST used to Update since PUT is idempotent. That way multiple PUTs for the same Order will place only one Order?
Tawani
  • 11,067
  • 20
  • 82
  • 106
39
votes
1 answer

Why don't browsers support PUT and DELETE requests and when will they?

I'm seeing many frameworks recently that have decided to "fake" PUT and DELETE requests in form submissions (not ajax). Like Ruby on Rails. They seem to be waiting for browsers to catch up. Are they waiting in vain? Is this even slated to be…
pixelearth
  • 13,674
  • 10
  • 62
  • 110
38
votes
7 answers

Consequences of POST not being idempotent (RESTful API)

I am wondering if my current approach makes sense or if there is a better way to do it. I have multiple situations where I want to create new objects and let the server assign an ID to those objects. Sending a POST request appears to be the most…
mibollma
  • 14,959
  • 6
  • 52
  • 69
35
votes
4 answers

Should HTTP PUT create a resource if it does not exist?

Lets suppose that someone performs a PUT request on my endoint: /resources/{id} However there is not resource with the given id stored in my PostgreSQL database. According to the RFC 2616, I should create the resource if I am capable to: The PUT…
Zucca
  • 561
  • 1
  • 7
  • 21
34
votes
6 answers

Are PUT and POST requests required/expected to have a request body?

I'm writting a RESTful api, and at I'm thinking about the process of a user creating a key. I have the following possibilities: GET request to /new/ - although it's very easy I think I won't use this, because I heard GET is for…
João Pinto Jerónimo
  • 9,586
  • 15
  • 62
  • 86