如何将curl命令转换为http请求?

时间:2016-11-01 15:02:12

标签: rest google-chrome http curl

如果我使用Chrome REST客户端(HTTP请求),那么相当于下一个curl命令会是什么?

curl --header 'Expect: ' -F username=bob -F password=secret -F file=@'image.jpg' http://api.service.me/api/file

我已经发现该网址为http://api.service.me/api/file。但我不知道如何解析-F username=bob -F password=secret -F file=@'image.jpg' params。

我也以base64格式发送图像。

1 个答案:

答案 0 :(得分:-5)

the curl man page可以看出,-F被解释为

  

这让curl模拟用户按下提交按钮的填写表单。根据RFC2388,这会导致使用Content-Type multipart / form-data卷曲数据。

关于此特殊请求正文编码有a ton of answers

相关问题