rest - HATEOAS For a Browser-Based Client Consuming a RESTful Web API -


i designing restful api in asp.net, , designing 1 browser-based client consume restful api (also using asp.net). now, both client , api serviced same solution.

a concept having difficulty wrapping head around how can have logical separation between client , api without compromising synchronization of client page mappings data (from api) displayed in pages. fundamental nature of browser-based application, served in restful manner; discovery of additional client pages via single entry-point , hateoas. also, restful api, resources (application data) discovered @ runtime via single entry-point , hateoas.

for me, concept translates follows:

for client:

welcome page (my client entry-point): www.example.com/home

within html of page, have links to:

www.example.com/profilepage www.example.com/contactspage 

etc...

for api:

entry point:

www.api.example.com 

my json result (or other media type response) contains links following:

www.api.example.com/resourcetobedisplayedonprofilepage www.api.example.com/resourcetobedisplayedoncontactspage 

am correct far in understanding? how can have client know how data respective screen when links in each page's html purely pages?

(my motivation separation scalability , performance purposes. nice able cache layout, styling, , scripting client application pages without context on data being displayed pages. expect stagnancy of page layouts far greater data can displayed within pages, therefore allowing me cache pages far greater amount of time.)

also, given explanation of understanding, can see additional aspects of rest may potentially failing consider in design, or downright wrong?

i think need use xhtml media type instead of json , working link.

you can follow link session: hypermedia apis jon moore described use of xhtml media type instead of json.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -