rest - What should a link extension relation type URI point to in a RESTful API? -


i've been designing api needs restful, , have managed define system uses exclusively http headers , query string parameters define meta data body of responses free actual resource data only.

however i'm thinking links hateoas, , due wanting keep in http headers or query string parameters i've decided on using http link header field.

this has brought question rel attribute i'm having trouble finding direct answer for.

my idea collections of resources 1 of links sent in response like: link: <https://api.domain.com/things/{id}>; rel="..."

this allow client use simple string expansion, defined in rfc6570, create correct resource uri each resource in collection without me having embed meta data each resource , without client needing know other uri template , resource id.

however, i'm not sure rel should here, or should point to.

in rfc5988, says extension relation type must uri and:

although uri can point resource contains definition of semantics of relation type, clients should not automatically access resource avoid overburdening server.

my question is, should definition in restful api?

by looks of make rel https://api.domain.com/media/thing, or that.

but should actual definition content be?

it looks technically anything, example plain text document short explanation.

is there restful standard these kinds of rel attributes , should point to?

any appreciated.

looking @ richardson's maturity model level 3, rel seems representing name of published link/relationship. in case might translate curie:thing-by-id (provided you're using curies suggested in proposed hal draft), example. idea client search link name (rel), without peering actual url.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -