teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

2019/03/11 03:41

投稿

退会済みユーザー
answer CHANGED
@@ -1,4 +1,18 @@
1
1
  > そもそもGETにリクエストボディって指定できるのでしょうか
2
2
 
3
3
  出来ると思うよ
4
- 不完全なHTTPクライアント実装に対する譲歩として、POSTリクエスト使うことはあると思うが、やっちゃだめとはかかれていねかったと思う
4
+ 不完全なHTTPクライアント実装に対する譲歩として、POSTリクエスト使うことはあると思うが、やっちゃだめとはかかれていねかったと思う
5
+ くわしくはここらへんにかいてあるとおもうよー
6
+ https://www.elastic.co/guide/en/elasticsearch/guide/current/_empty_search.html#get_vs_post
7
+
8
+
9
+ > ## A GET Request with a Body?
10
+ >
11
+ > The HTTP libraries of certain languages (notably JavaScript) don’t allow GET requests to have a request body. In fact, some users are suprised that GET requests are ever allowed to have a body.
12
+ >
13
+ > The truth is that RFC 7231—the RFC that deals with HTTP semantics and content—does not define what should happen to a GET request with a body! As a result, some HTTP servers allow it, and some—especially caching proxies—don’t.
14
+ >
15
+ > The authors of Elasticsearch prefer using GET for a search request because they feel that it describes the action—retrieving information—better than the POST verb. However, because GET with a request body is not universally supported, the search API also accepts POST requests
16
+
17
+
18
+ まあ、バージョンふるいドキュメントだし、あんま期待せずに読んでいくのがいいんじゃないかねー