Questions tagged [rest]
REST (Representational State Transfer) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. It has increased in popularity relative to RPC architectures such as SOAP due to the intrinsic de-coupling of client from server that comes from having a uniform interface between heterogeneous systems.
94,144
questions
6374
votes
42
answers
3.5m
views
What is the difference between POST and PUT in HTTP?
Background Information Analysis:
According to RFC 2616, § 9.5, POST is used to create a resource:
The POST method is used to request that the origin server accept the entity enclosed in the request ...
4191
votes
35
answers
1.7m
views
What exactly is RESTful programming?
What exactly is RESTful programming?
3835
votes
31
answers
4.4m
views
How do I POST JSON data with cURL?
I use Ubuntu and installed cURL on it. I want to test my Spring REST application with cURL. I wrote my POST code at the Java side. However, I want to test it with cURL. I am trying to post a JSON data....
3146
votes
24
answers
2.4m
views
HTTP GET with request body
I'm developing a new RESTful webservice for our application.
When doing a GET on certain entities, clients can request the contents of the entity.
If they want to add some parameters (for example ...
1356
votes
14
answers
1.2m
views
SOAP vs REST (differences)
I have read articles about the differences between SOAP and REST as a web service communication protocol, but I think that the biggest advantages for REST over SOAP are:
REST is more dynamic, no ...
1355
votes
18
answers
847k
views
HTTP response code for POST when resource already exists
I'm building a server that allows clients to store objects. Those objects are fully constructed at client side, complete with object IDs that are permanent for the whole lifetime of the object.
I ...
1287
votes
16
answers
964k
views
Use of PUT vs PATCH methods in REST API real life scenarios
First of all, some definitions:
PUT is defined in Section 9.6 RFC 2616:
The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an ...
1149
votes
24
answers
1.5m
views
How to set the Content-Type header for an HttpClient request?
I'm trying to set the Content-Type header of an HttpClient object as required by an API I am calling.
I tried setting the Content-Type like below:
using (var httpClient = new HttpClient())
{
...
1094
votes
17
answers
855k
views
Is an entity body allowed for an HTTP DELETE request?
When issuing an HTTP DELETE request, the request URI should completely identify the resource to delete. However, is it allowable to add extra meta-data as part of the entity body of the request?
1056
votes
10
answers
800k
views
Which status code should I use for failed validations or invalid duplicates?
I am building an application with a REST-based API and have come to the point where I am specifying status codes for each requests.
What status code should i send for requests failing validation or ...
1038
votes
11
answers
977k
views
Posting a File and Associated Data to a RESTful WebService preferably as JSON
In an application I am developing RESTful API and we want the client to send data as JSON. Part of this application requires the client to upload a file (usually an image) as well as information about ...
873
votes
7
answers
654k
views
Best practices for API versioning? [closed]
Are there any known how-tos or best practices for web service REST API versioning?
I have noticed that AWS does versioning by the URL of the endpoint. Is this the only way or are there other ways to ...
839
votes
18
answers
318k
views
Best Practices for securing a REST API / web service [closed]
When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ?
When building a SOAP API you have WS-...
837
votes
25
answers
1.3m
views
Setting Authorization Header of HttpClient
I have an HttpClient that I am using for a REST API. However I am having trouble setting up the Authorization header. I need to set the header to the token I received from doing my OAuth request.
I ...
830
votes
27
answers
365k
views
Should I use Singular or Plural name convention for REST resources?
Some RESTful services use different resource URIs for update/get/delete and Create. Such as
Create - using /resources with POST method (observe plural) at some places using /resource (singular)
...