zoukankan      html  css  js  c++  java
  • curl使用

    curl -H "Content-Type:application/json" -X POST --data '{"name":"zhangsan"}' http://127.0.0.1:9000/helloWorld

    curl命令用法:

    curl [options...] <url>

    常用参数有:

    --connect-timeout <seconds>:连接超时时间。

    --cookie <name=string/file>:指定cookie。可以一个个指定,也可以指定文件。

    -d或者--data <data>:指定http post body。

    --data-ascii <data>:指定http post ascii data。

    --data-binary <data>:指定http post binary data。

    --data-urlencode <name=data/name@filename>:指定http post urlencoded data。

    -F或者--form <name=content>:指定http post multipart data。

    --form-string <name=string>:指定http post multipart data。

    -H/--header <line>:指定请求头。

    --libcurl <file> Dump libcurl equivalent code of this command line

    -m/--max-time <seconds>:整个request的超时时间,包括连接时间和数据传输时间。

    --noproxy:指定哪些host不用代理,多个host用逗号分隔。

    -o/--output <file>:将响应输出到指定文件中,默认是输出到当前窗口中。

    -x/--proxy <host[:port]>:在指定host和port上用代理。

    -X/--request <command>:指定是get请求还是post请求。

    --retry <num>:请求异常时的重试次数。

    --retry-delay <seconds>:每次重试,中间歇息多少秒。

    -A/--user-agent <string>:指定user-agent。

  • 相关阅读:
    高性能SQL编码规范
    识别SQL Server 性能杀手
    centOS7安装nginx
    linux安装apache
    算术表达式的前缀表达式,中缀表达式和后缀表达式
    有特殊字符的JSON串
    sqlserver 找到执行慢的sql
    SQL索引建立遵守六大铁律
    [SQL Server 2005/2008] select语句中指定索引
    ubuntu下vsftpd虚拟用户配置
  • 原文地址:https://www.cnblogs.com/koushr/p/13845834.html
Copyright © 2011-2022 走看看