tschwab
tschwab

Reputation: 1096

Is the HTTP SEARCH method standardized?

I am thinking about how to implement a REST API endpoint for searching. As I see it, I have four options for how to implement search options, each with pros and cons:

  1. Use a GET endpoint with querystring params
  2. Use a GET endpoint with a payload (for example, a JSON payload)
  3. Use a POST endpoint with a payload
  4. Use a SEARCH endpoint with a payload

For completeness, here are the pros and cons I am thinking of:

A lengthy, nuanced, and opinionated discussion could be had as to which of these is best, but that discussion is not the purpose of this question. Instead I ask: Is the SEARCH verb merely obscure and rarely used but still an official method, or is it non-standard?

I found this draft for the method, but not many more official documents about it. The draft echoed some of the points of the quadrilemma I posed above. It appears to me that the method is still merely a draft and can't be called "standard", though I am not overly familiar with how to read those documents.

Functionally, I guess my question is: Can I rely on self-touted standards compliant software to handle the SEARCH method? And if they don't handle it, can I appeal to their claim of standards compliance to force them into handling it? Boiled down even further, is it a reliable verb?

Upvotes: 16

Views: 10671

Answers (3)

Ilya Serbis
Ilya Serbis

Reputation: 22313

SEARCH method draft specification has been replaced by the HTTP QUERY method draft.

According to the list of the HTTP request methods SEARCH was standardized only for the WebDAV.

Upvotes: 2

wener
wener

Reputation: 7760

Almost, but they may use QUERY instead.

HTTP SEARCH is a new HTTP method, for safe requests that include a request body. It's still early & evolving, but it was recently adopted as an IETF draft standard, and it's going to add some great new tools for HTTP development everywhere.

from httptoolkit blog

Upvotes: 7

Julian Reschke
Julian Reschke

Reputation: 42045

SEARCH is defined on the IETF Standards Track in RFC 5323. That said, it currently is only applicable to WebDAV, and few servers support it.

Upvotes: 6

Related Questions