#HATEOAS

1 messages · Page 1 of 1 (latest)

broken hare
#

if i want to implement Hateoas for resource x, should i do it for every Crud operation?

serene gardenBOT
#

<@&987246399047479336> please have a look, thanks.

serene gardenBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

stuck mortar
#

hey, its me from the other server

#

you can't escape

#

HATEOAS is not for CRUD operations

#

or any operations driven by a programattic client

broken hare
stuck mortar
#

never

#

you never do this

#

HATEOAS and JSON apis do not mix

broken hare
#

only in get requests?

stuck mortar
#

the only modern HATEOAS client is a web browser

#

the only place where HATEOAS practically applies is in HTML responses

broken hare
#

lets say i have to implement

#

it as part of my backend

#

in which crud operations

stuck mortar
#

so neither in get or post requests should you be returning links in json

broken hare
#

i should return the linsk as well?

#

when then?

stuck mortar
#

never, unless you are rendering html to be shown by a web browser

broken hare
#

what if i have to

stuck mortar
#

for an assignment from a teacher who is uneducated?

broken hare
#

not exactly

#

its not my choice

stuck mortar
#

for work?

broken hare
#

for a friends project

stuck mortar
#

friend's school project?

#

and if so then the answer is GET request

#

you aren't changing any underlying resources, just producing a response

#

thats a GET request

broken hare
#

i know there is no reason on delete

#

but how about put?

stuck mortar
#

what do you mean "reason"?

broken hare
#

if the resource is deleted

#

what link should i return?

stuck mortar
#

nothing

broken hare
#

yes nothing so need to implement it in a delete method

#

i was asking about updating a resource

#

i think also in updating a resource

#

should be implemented there

stuck mortar
#

sure?

broken hare
#

ok so in 2 cases?

#

right?

#

in get and put?

stuck mortar
#

get, put, post?

broken hare
stuck mortar
#

idk

broken hare
#

where includes all the resources?

stuck mortar
#

none of these should include links

#

so idk - what does your friend's professor want?