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.
8,214
questions
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 ...
113
votes
13
answers
91k
views
Returning data from async call in Swift function
I have created a utility class in my Swift project that handles all the REST requests and responses. I have built a simple REST API so I can test my code. I have created a class method that needs to ...
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?
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?
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....
304
votes
12
answers
669k
views
How do I make a request using HTTP basic authentication with PHP curl?
I'm building a REST web service client in PHP and at the moment I'm using curl to make requests to the service.
How do I use curl to make authenticated (http basic) requests? Do I have to add the ...
404
votes
9
answers
475k
views
How to get body of a POST in php?
I submit as POST to a php page the following:
{a:1}
This is the body of the request (a POST request).
In php, what do I have to do to extract that value?
var_dump($_POST);
is not the solution, ...
796
votes
14
answers
430k
views
RESTful Authentication
What does RESTful Authentication mean and how does it work? I can't find a good overview on Google. My only understanding is that you pass the session key (remeberal) in the URL, but this could be ...
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 ...
356
votes
28
answers
527k
views
How to POST raw whole JSON in the body of a Retrofit request?
This question may have been asked before but no it was not definitively answered. How exactly does one post raw whole JSON inside the body of a Retrofit request?
See similar question here. Or is this ...
356
votes
40
answers
1.7m
views
"SyntaxError: Unexpected token < in JSON at position 0"
In a React app component which handles Facebook-like content feeds, I am running into an error:
Feed.js:94 undefined "parsererror" "SyntaxError: Unexpected token < in JSON at position 0
I ran ...
94
votes
1
answer
37k
views
How to secure an API REST for mobile app? (if sniffing requests gives you the "key") [closed]
I know there are some authentication methods for API Basic Authentication, API Keys, OAuth 2.0 ... all of those methods add a header or a FormData param in the request.
Although you use SSL, it's &...
83
votes
6
answers
111k
views
How to handle CORS using JAX-RS with Jersey
I'm developing a java script client application, in server-side I need to handle CORS, all the services I had written in JAX-RS with JERSEY.
My code:
@CrossOriginResourceSharing(allowAllOrigins = ...
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())
{
...