rest - RESTful alternative to 3xx responses for JavaScript based clients -


Many of our REET services need to indicate that further action should be taken by the customer to complete the request. (Often the response to the request can be found under another URI)

In general, this HTTP is achieved through 3xx responses. However, in the case of JavaScript-based clients, the browser is redirection even before javascript code is reached.

Basically what I want is a lush way to inform the client (JavaScript code) that the response

I am thinking of two solutions:

  1. The URI with HTTP 200 OK has a URI that the URI is not adhering to me, I just do not like the creation of a whole unit bringing the whole URI. I want to get it through the HTTP header

  2. HTTP 204 has no content response with the location headers given URI. But here I am not sure that this "rest is obedient". Is it OK that HTTP 204 has no content with a space title, which is mainly used in redirection (with HTTP 3xx responses), or when a new resource has been created?

    Or is there a better solution?

    If I understand you correctly, then you have a process, say 5 steps . After Phase 5, some results have been prepared, for which you do not want to point through your customer, HTTP-3xx , but in the cleaner manner

    I would recommend that you use your JSON -response:

      in the  link  property. ... "link": [... "results": {"href": "/ calculation / 1234"} ...]}   

    Your customer can take this response And transforming it into a simple link / button

    This corresponds to the HATEOAS (the application state engine of hyperment), this indicates that the current situation provides results under a different location that is referred to < / P>

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -