0
0

More than 5 years have passed since last update.

HTTP2で非SSL(http)でのPOSTを試すには

Posted at

背景

mruby-hibariはコード眺めたら、POSTでのパラメータもRubyっぽく
扱えるようにすでに実装されていた。これを試したいと思った。

h2oのh2o_mrubyのexampleをベースにあれこれしていたので、httpsではなく、httpで
HTTP2を扱っていた。POSTはhtml書けば、できるが、ブラウザはHTTP2をhttpではアクセスできない。こまった。

httpsではなくhttpでHTTP2のPOSTを行う

nghttp2に付属のnghttpコマンドが任意のファイルをPOSTする機能があり、「-」を指定すると標準入力を対象にしてくれることが分かった。

 echo "param1=hogeguga&kjunichi=nomoney" |nghttp -d - 'http://127.0.0.1:8080/foo/'

で出来た。

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