groonga/groonga — pull request #101 by wm3 (2013-08-18 08:36:29+00:00)
Title: groonga-httpd: POST メソッドのサポート

現象
----------------

groonga-httpd で、 load コマンドを POST で実行しようとすると 「must send load data as body」という応答だけが帰ってきて読み込みに失敗してしまいます。

例
----------------

```
vagrant@precise64:~/groonga$ curl -v 'http://localhost:10041/d/table_create?name=Abc&key_type=ShortText'
* About to connect() to localhost port 10041 (#0)
* Trying 127.0.0.1... connected
> GET /d/table_create?name=Abc&key_type=ShortText HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:10041
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.4.2
< Date: Sun, 18 Aug 2013 08:33:05 GMT
< Content-Type: application/json
< Content-Length: 47
< Connection: keep-alive
<
* Connection #0 to host localhost left intact
* Closing connection #0
[[0,1376814785.18354,0.00130605697631836],true]
vagrant@precise64:~/groonga$
vagrant@precise64:~/groonga$ cat shortdata.txt
[
[ "_key" ],
[ 1 ],
[ 2 ],
[ 3 ],
[ 4 ],
[ 5 ],
[ 6 ],
[ 7 ],
[ 8 ],
[ 9 ],
[ 10 ]
]
vagrant@precise64:~/groonga$ curl -v --data-binary '@shortdata.txt' 'http://localhost:10041/d/load?table=Abc'
* About to connect() to localhost port 10041 (#0)
* Trying 127.0.0.1... connected
> POST /d/load?table=Abc HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:10041
> Accept: */*
> Content-Length: 125
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 125out of 125 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.4.2
< Date: Sun, 18 Aug 2013 08:34:41 GMT
< Content-Type: text/plain
< Content-Length: 27
< Connection: keep-alive
<
* Excess found in a non pipelined read: excess = 172, size = 27, maxdownload = 27, bytecount = 0
* Connection #0 to host localhost left intact
* Closing connection #0
must send load data as body
vagrant@precise64:~/groonga$

```