HTTP options method


#1

Hi,

in my API project I want to use the options http method. Could I have any informations about its implementation with JSON API rules?

I believe that in the specifications the options http method is not mentioned.

Thanks in advance for the answers.

Riccardo


#2

There’s no specific integration with JSON API’s rules. You just support it as normal.

Was there anything in particular you were thinking of?


#3

I would use the Options HTTP Method to (synthetically) document my REST endpoints. For instance, for one endpoint, what parameters are available, what are mandatory, etc. I would like that an user would be able to use my REST service only by reading the output of the Options HTTP Method.
I hope I have explained well my issue. :grin:
Thanks


#4

Sure, then just do it all as normal. Nothing special here.


#5

Thanks for the answer. :wink:


#6

Only thing I’d add here: If you implement options, make sure that that endpoint returns standard application/json rather than application/vnd.api+json. That way, if JSON API defines OPTIONS semantics in the future, your server won’t be in conflict with them.