» Including created resource in HTTP POST response?
Including created resource in HTTP POST response?
|August 24, 2014
Posted by forumadmin
RFC7231 says a server should respond to a resource-creating POST request with status 201 and a Location header to the new resource. In some situations it could be convenient for the server to include a representation of the created resource in its response, but in other cases this would be a waste of bandwidth.
Might this be a good place for content negotiation within the post request? If so, what request headers should be sent to indicate that the client would like the resource returned in addition to the Location header?
More Related Questions
- PUT vs POST in REST According to the HTTP/1.1 Spec:
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by […]
- HTTP PUT Request limit I am designing a RESTful API when I noticed something strange.
When I make a POST request for creating a new record, the form data is sent in request payload.
But when I make a PUT […]
- Uploading file without multipart/form-data (server to server) From this answer http://stackoverflow.com/a/1695287/256400 , I get the feeling that multipart/form-data is needed to upload file from browser to server. But if my use case is to upload […]
- Making POST Requests in Backbone.js I have a RESTful server, which accepts url encoded parameters.
In my case, making a post request to https:// my server:8443/test/auth
Set the request header as
Content-Type : […]
- HTTP Test server that accepts GET/Post calls I need a live test server that accepts my requests for basic information via HTTP GET and also allows me to POST (even if its really not doing anything). This is entirely for test […]
- REST API error return good practices I'm looking for guidance on good practices when it comes to return errors from a REST API. I'm working on a new API so I can take it any direction right now. My content type is XML at the […]
- ASIFormDataRequest POST Request Issue im using this code to post data to my server
NSURL *mainurl = [NSURL URLWithString:@"http://xxxxxxxxxx/api/PhonePaymentApi/Transaction/"];
NSString * postdata = [[NSString […]
- How are parameters sent in an HTTP POST request? In an HTTP GET request, parameters are sent as a query string:
In an HTTP POST request, the parameters are not sent along with the […]
- Specify allowed content types when anwering with HTTP 415 I'm looking into adding (more) precise responses to REST API client (4xx) errors. The direction seems quite clear, as seen here:
406 [sic] when you can't send what they want, 415 when […]
- RESTful best practice for authentication and thank all of you for viewing this question.
I am not sure to on how do this so i am asking for the community help on this matter.
I read int his post Can you help me understand this? […]