美文网首页
Command - curl

Command - curl

作者: 是瑞瀛呀 | 来源:发表于2019-11-22 00:26 被阅读0次

1. 基本用法

curl URL:URI

2. 携带请求数据

curl -X POST URL:URI -d 'param1=1&param2=[{"value":1,"value":1}]'
curl -v --globoff URL:URI?param1=1\&param2="[{\"k\":v}]"

3. 携带json数据,指定请求数据格式

curl -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"from\":\"5.0.0\",\"itemId\":94401600,\"amount\":100000}" URL:URI


注:若相应信息乱码 ,可通过iconv进行转码
iconv [option] [file]:
  options:  
    -f 输入编码 ( 目标的编码 charset->utf-8 则为utf-8)
    -t 输出编码
    -l 列出所有已知的编码
    -o 输出文件

Eg--> curl www.baidu.com | iconv -f utf-8 -t gb2312

相关文章

网友评论

      本文标题:Command - curl

      本文链接:https://www.haomeiwen.com/subject/arnxwctx.html