curl请求问题

curl请求问题

格式化命令行

  • \后面必须结束,不能有空格
  • data里面的数据的间隔比如示例中的operation前面必须是空格而不能是tab等

示例

curl -v -X POST 'xxxxxxxx' \
--header 'Content-type: application/json' \ 
--header 'xxx' \
--data '{
    "operation": "xxxx",
    "in_args": {
        "condition": {
            "in_date": "xxxx"
        }
    }
}'

设置超时时间

两个超时时间:一个是连接超时时间,另一个是整个过程允许的最大时间,

--connect-timeout Maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once curl has connected this option is of no more use. See also the -m/--max-time option. If this option is used several times, the last one will be used.

这个是指定连接超时时间。 如果出错, 提示形如:curl: (28) connect() timed out!

-m/--max-time Maximum time in seconds that you allow the whole operation to take. This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down. See also the --connect-timeout option. If this option is used several times, the last one will be used.

这个是指定整个过程最大的允许时间。 出错提示如:curl: (28) Operation timed out after 2000 milliseconds with 0 bytes received

本文作者:朝圣

本文链接:www.zh-noone.cn/2021/6/curl请求问题

版权声明:本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0许可协议。转载请注明出处!

mysql嵌套子查询Materialization(物化)影响
0 条评论