0

curl コマンドに問題があります。例えば

$ curl --connect-timeout 2000  -v -X POST ....
* About to connect() to ************************
*   Trying ::1... Connection refused
*   Trying 127.0.0.1... connected
* Connected to ********************
> POST ********************** HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.9.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: ******
> Accept: */*
> Content-Type: application/json
> Content-Length: 92
>
< HTTP/1.1 200 OK
< ****************:
< X-b: **************
< X-a: ***************
< Content-Type: application/json
< Content-Length: 8228
< Server: Jetty(6.1.26)


....
\"f1\":\"v1\"},\"f2\":{\"f3\":false},\"f4\":\"v4\",\"f5\":fa* Connection #0 to host localhost left intact
* Closing connection #0
lse,\"f6\":25}}"}}

注意してください、問題は次のとおりです。

  • jsonは引用されました\
  • で区切られたコンテンツConnection #0 to host localhost left intact Closing connection #0

私の質問は、これらの問題を取り除く方法は?

4

1 に答える 1

0

標準出力と標準エラーを結合している可能性があるため、エラー メッセージが表示されます。標準エラーをリダイレクトしてみてください:

curl 2>/dev/null

文字列を unqoute するには、こちらを参照してください: Linux/Bash: How to unquote?

于 2013-08-29T08:48:02.647 に答える