0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

つい最近、風の噂でQUERYというHTTPメソッドが実装されたと聞きました。
別にPOSTやGETで実装すればいいとは思ったのですが、そこがこのQUERYの面白いところらしい。

QUERYはGETとPOSTのいいとこどり。

GETって、リクエストボディってあってないようなものです。
なので、クエリパラメータやパスパラメータに検索ワードなどを入れないといけません。
かといって、POSTでリクエストボディに検索クエリを載せてリクエストすると、POSTはリソース変更の可能性があると見られて、キャッシュされません。

このQUERYというメソッドはリソースは変更しないけど、ボディパラメータが有効で、キャッシュされるというメソッドらしいです。

QUERYの仕様

機能 可能か
キャッシュ ☑️
リクエストボディ ☑️
リソースの変更
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?