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.

(Not to be confused with or reST)

REST (REpresentational State Transfer) is an architectural style that uses identification of resources; manipulation of resources through representations; self-descriptive messages, and hypermedia as the engine of application state, to build distributed systems that are scalable and resilient to change.

The term was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation. Fielding is one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification versions 1.0 and 1.1.

In simple language, REST is an alternative to SOAP based web services. Where SOAP tries to model the exchange between client and server as calls to objects, REST tries to be faithful to the web domain.

Resources


Examples

A website's RESTful API is queried to find out information on a user, specified by a numerical ID.

Request Type: GET
http://www.api.website.com/users/12345

Returns, in a format for this example:

{"username" : "theuser",
 "userid"   :  12345,
 "first"    : "George",
 "last"     : "Washington"}

Question Index

Searching

REST search interface and the idempotency of GET
RESTful URL design for search
Best practice for implementing long-running searches with REST
Querystring in REST Resource url
What is the best way to create RESTful complex queries?
Question on REST conventions: retrieving information where lots of params are needed

Resource Design

How to design a RESTful collection resource?
RESTful design of a resource with binary states
RESTFful/Resource Oriented Design
RESTful resource - accepts a list of objects
RESTful API creates a globally unique resource
REST's 'resource communication mechanisms' and 'on-the-fly' improvement of a client's knowledge of them
How to move a REST resource?

Media Types

REST Media type explosion
Creating hypermedia links in a custom media-type
Custom content types: XLink vs. Atom

Books

Related tags

92665 questions
21
votes
4 answers

Isn't HTTP verb PUT used for updating and not creating content?

In CouchDB, to create a new document you send: PUT /albums/70b50bfa0a4b3aed1f8aff9e92dc16a0 Isn't PUT used to update data and not creating it?
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
21
votes
3 answers

How to send JSON Object from POSTMAN to Restful webservices

I'm trying to send json from POSTMAN to RESTful webservice. I had followed this tutorial url for sending json through POSTMAN. My URL : http://localhost:8080/myWebService/rest/dataInsert/insert My Service method: @POST @Path("/insert") …
dev777
  • 999
  • 6
  • 17
  • 34
21
votes
1 answer

Using name binding annotations in Jersey

How does the @NameBinding annotation work in Jersey to apply a filter on particular resource methods or resource class? Consider the following annotation: @NameBinding @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD,…
chaitanya
  • 693
  • 2
  • 7
  • 16
21
votes
2 answers

Rest APIs in Go - using net/http vs. a library like Gorilla

I see that Go itself has a package net/http, which is adequate at providing everything you need to get your own REST APIs up and running. However, there are a variety of frameworks; the most popular maybe say gorilla. Considering that one of the…
Ankur Garg
  • 2,553
  • 8
  • 30
  • 41
21
votes
1 answer

flask-RESTful vs flask-RESTless, which should be used, and when

What are the key differences of these two libraries.In terms of usability, and features If you already have a huge number of model classes, using flask-restLESS makes perfect sense, right?. What are the features it would lack, if it would done with…
ISONecroMAn
  • 1,460
  • 2
  • 16
  • 23
21
votes
1 answer

What is OAuth and how does it secure REST API calls?

I have mobile application REST API calls which hits to my server without any token or security mechanisam. I want to secure my API calls. I am trying to understand what is OAuth and how it will secure my mobile app REST API calls which are hitting…
Sanjay Salunkhe
  • 2,665
  • 5
  • 28
  • 52
21
votes
3 answers

How to describe WebSocket interface?

For restful services Swagger is a standardized way to describe the interface. Is there already a way to describe Websocket interfaces?
JohnDoe
  • 2,422
  • 5
  • 29
  • 44
21
votes
1 answer

WCF 4 Rest Getting IP of Request?

Hey, how do you get the IP address of the person making a request in something like the following: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] …
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
21
votes
1 answer

HTTP status code for PUT

A PUT requests can have many outcomes, and I was wondering which status code would be best for each of them. Say I want to create a new resources, so I do something like that: PUT http://example.com/resources/resource-1 And I would get a HTTP 201…
evuez
  • 3,257
  • 4
  • 29
  • 44
21
votes
3 answers

Golang serialize/deserialize an Empty Array not as null

Is there a way to serialize an empty array attribute (not null) of a struct and deserialize it back to an empty array (not null again)? Considering that an empty array is actually a pointer to null, is the perceptible initial difference between an…
DLopes
  • 567
  • 2
  • 6
  • 13
21
votes
2 answers

non-RESTful vs. RESTful

I am really new to programming, and having some trouble understanding the concept of RESTful APIs. I've read about REST and RESTful APIs. I've looked through the questions already asked here in SO, but can't seem to get any better understanding of…
Vijitha Hegna
  • 213
  • 1
  • 2
  • 5
21
votes
4 answers

How to intentionally cause a 400 Bad Request in Python/Flask?

A consumer of my REST API says that on occasion I am returning a 400 Bad Request - The request sent by the client was syntactically incorrect. error. My application (Python/Flask) logs don't seem to be capturing this, and neither do my…
Matthew Moisen
  • 16,701
  • 27
  • 128
  • 231
21
votes
4 answers

Get wwwroot folder path from ASP.NET 5 controller VS 2015

Sorry for a noob question, but it seems I can't get Server.MapPath from Controller. I need to output json file list from images folder at wwwroot. They are is at wwwroot/images. How can I get a reliable wwwroot path? using System; using…
Magician
  • 1,944
  • 6
  • 24
  • 38
21
votes
10 answers

Adding org.glassfish.jersey.archetypes in eclipse

I am trying to create a maven project in eclipse. I am trying create a archetype but getting the below error. Can't resolve Archetype org.glassfish.jersey.archetypes:jersey-quickstart-webapp:2.16 org.eclipse.core.runtime.CoreException: Could…
user1326301
  • 231
  • 1
  • 3
  • 4
21
votes
5 answers

How to post a list to Spring Data Rest?

I followed this example, which allows to post a unique Person object. I want a REST service where I can post a collection of Person at once, e.g. a list/any collection named Team with numerous Person objects in just one call. I mean, my question is…
Jim C
  • 3,957
  • 25
  • 85
  • 162