RESTful API methods; HEAD & OPTIONS

后端 未结 3 582
一生所求
一生所求 2020-12-07 13:11

I\'m writing a RESTful API module for an application in PHP, and I\'m a bit mixed on the verbs HEAD and OPTIONS.

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 13:42

    OPTIONS tells you things such as "What methods are allowed for this resource".

    HEAD gets the HTTP header you would get if you made a GET request, but without the body. This lets the client determine caching information, what content-type would be returned, what status code would be returned. The availability is only a small part of it.

提交回复
热议问题