20
votes
3answers
1k views

What does HATEOAS offer for discoverability and decoupling besides ability to change your URL structure more or less freely?

Lately I've been reading about Hypermedia as the Engine of Application State (HATEOAS), the constraint that is claimed to make a web API "truly RESTful". It boils down to basically including links ...
1
vote
2answers
97 views

How to indicate to a web server the language of a resource

I'm writing an HTTP API to a publishing server, and I want resources with representations in multiple languages. A user whose client GETs a resource which has Korean, Japanese and Trad. Chinese ...
0
votes
0answers
42 views

How to have my callbacks authenticated in a REST app?

I'm developing a REST application and I allow my clients to authenticate in several ways (typically using Authorization: Token ... as in OAuth 2.0, but also there's session-based auth option for the ...
3
votes
2answers
82 views

How should I specify locations where clients can resolve authorization problems in a REST API?

I'm working through an API design where a user's authentication will be verified by the presence of a valid forms authentication ticket in a session cookie. However, there are additional levels of ...
3
votes
3answers
760 views

Why REST Api do not follow the Facade design pattern

In comparing REST [api] structure with a OO model, I see these similarities: Both: Are data oriented REST = Resources OO = Objects Surround operation around data REST = surround VERBS (Get, ...
5
votes
2answers
1k views

Comparing TCP/IP applications vs HTTP applications [closed]

I'm interested in developing a large-scale user-facing website that is written in Java. As for design, I'm thinking of developing independent, modular services that can act as data providers to my ...
2
votes
3answers
101 views

Specifying the format in which I want to get a response through POST

It's a good practice to let a client specify the format in Web REST API: GET /api/items/123.csv However, not only GET can return some answer, but POST also can do Status: 201 Created { mgs: ...
2
votes
2answers
237 views

Should an Http API always return a body?

Is there some sort of standard regarding http api responses? After reading this discourse thread I started to wonder. We are developing our public http json api at my work, and we do not return ...
2
votes
2answers
884 views

Is it safe to transmit access tokens via HTTP headers?

It's the first RESTful web service and I am concerned about security issues. Is it safe to transmit my access token via HTTP headers? For example: POST /v1/i/resource HTTP/1.1 Content-Type: ...
5
votes
2answers
1k views

How should a REST API handle PUT requests to partially-modifiable resources?

Suppose a REST API, in response to a HTTP GET request, returns some additional data in a sub-object owner: { id: 'xyz', ... some other data ... owner: { name: 'Jo Bloggs', role: ...
4
votes
2answers
584 views

What can REST API do that a API using HTTP URL query strings cannot do?

I'm learning about REST and had the chance to build a basic REST API. After doing so, most of the material I read was internalized and I now have a better understanding of it. However, I do not ...
0
votes
1answer
205 views

Rest API Architecture from Rest in Practice book

We maintain an API that as part of its purpose makes a call to an external API. This external API takes a few seconds to fulfil the request we make to it. With our current architecture the request is ...
18
votes
2answers
883 views

Levels of user permissions in a RESTful API

Let's say I have a company that ranks the cutest cats on the internet. I offer a resource at /cats/ which provides users with the latest, cutest adorable cats. Users can either get just the top 3 ...
6
votes
4answers
286 views

When did the first “REST”-model and friendly URL web technology come to be?

Everyone knows that the "current" way to do things is to have user-readable URLs. Like: http://example.com/blog/edit/1234 Rather than: http://example.com/blog.php?action=edit&id=1234 When ...
3
votes
2answers
288 views

RESTful URI's, Creating a new noun/uri or add a queryparameter

I have a Person class with a one to many relationship to Employment. A Person in the CRM can have multiple Employments (historic data). My current REST URI for this class looks like this: ...
6
votes
2answers
1k views

Are there any problems with implementing custom HTTP methods?

We have a URL in the following format /instance/{instanceType}/{instanceId} You can call it with the standard HTTP methods: POST, GET, DELETE, PUT. However, there are a few more actions that we ...
9
votes
2answers
2k views

Trailing slash in RESTful API

I have been having a debate about what to do with a trailing slash in a RESTful API. Lets say I have a resource called dogs and subordinate resources for individual dogs. We can therefore do the ...
6
votes
2answers
2k views

Implementing the command pattern in a RESTful API

I'm in the process of designing an HTTP API, hopefully making it as RESTful as possible. There are some actions which functionality spreads over a few resources, and sometime needs to be undone. I ...
6
votes
2answers
367 views

Versioned Resources to Improve Cacheability

Here's an API concept which could be useful for performance optimisation. It's an example of key-based cache expiry applied to a broader internet-wide context instead of the internal Memcached-style ...
4
votes
3answers
226 views

What is the right HTTP method for upvoting?

From a RESTful point of view, what is the most appropriate HTTP method for the action of upvoting a forum post (like on StackExchange)? I would say POST for voting and DELETE for canceling vote, but ...
6
votes
1answer
342 views

REST API rule about tunneling

Just read this in the REST API Rulebook: GET and POST must not be used to tunnel other request methods. Tunneling refers to any abuse of HTTP that masks or misrepresents a message’s intent and ...
1
vote
2answers
245 views

Should HTTP Verbs Be Used Semantically?

If I'm making a web application which integrates with a server-side backend, would it be considered best practice to use HTTP methods semantically? That is, for example, if I'm fetching data (e.g., to ...
4
votes
1answer
1k views

HTTP Response Header for a unique Request ID for REST service

For our REST service I want to send back a unique request ID with every response; useful for debugging internal projects but also for offering support to any third parties who might use the service in ...
13
votes
4answers
6k views

REST - Tradeoffs between content negotiation via Accept header versus extensions

I'm working through designing a RESTful API. We know we want to return JSON and XML for any given resource. I had been thinking we would do something like this: GET /api/something?param1=value1 ...
3
votes
1answer
2k views

RESTful HTTP OPTIONS request content

I'm having trouble determining what I might put in the body of a response to an OPTIONS request? are there conventions? standards? What do you put? do you just provide a list of other METHODS? should ...
12
votes
2answers
2k views

Suggested HTTP REST status code for 'request limit reached'

I'm putting together a spec for a REST service, part of which will incorporate the ability to throttle users service-wide and on groups of, or on individual, resources. Equally, time-outs for these ...
8
votes
6answers
750 views

What was SOAP invented for?

This question is inspired by this one. What was the initial goal of inventing SOAP? Why was it invented when we had old kind HTTP and REST?
3
votes
2answers
475 views

Primary reasons for using REST/OData instead of a custom convention

What do you think would be the primary reasons to make APIs with REST or OData instead of just making everything custom (for example only using GET requests, even for setting variables). Reasons for ...
4
votes
3answers
2k views

Applying RESTful design to an entire website?

This all may come across very newbish, but I'm trying to wrap my head around designing a website that is thoroughly RESTful. I understand applying RESTful design to things like Users, Photos, Blog ...