Last active
June 14, 2017 04:35
-
-
Save stknohg/02950784b34594391177431ce32bcc58 to your computer and use it in GitHub Desktop.
HTTPieをコマンドプロンプト、PowerShellコンソール上で実行するアレ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM コマンドプロンプトで実行する場合 | |
REM " を \ でエスケープし ' は除外する。 | |
http post http://localhost/ json:=[\"http\",\"pies\"] -v -p HB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShellコンソールで実行する場合 | |
# " を \ でエスケープ | |
http post http://localhost/ json:='[\"http\",\"pies\"]' -v -p HB | |
# または ' を使わずに以下の様にしてもOK。 | |
http post http://localhost/ "json:=[\""http\"",\""pies\""]" -v -p HB |
cmd.exeはシングルクォートを特別視せずにそのまま解釈して渡すので、JSON的に正しくない文字列として解釈されてるんではないでしょうか。
@itn3000 その様です。シングルクオートを使わないのが良さそうですね。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Windows 10, Python 3.6.0, HTTPie 0.9.9で実施。