【问题标题】:Import cURL Command For Uploading Files Into Postman将文件上传到 Postman 的导入 cURL 命令
【发布时间】:2018-10-21 17:08:30
【问题描述】:

我想将以下 cURL 转换为特定的邮递员脚本,以便我可以通过邮递员发布请求。

/usr/bin/curl --request POST -F "files1=@image_0026.jpg" -F "files2=@image_0027.jpg" -F "files3=@image_0028.jpg" -F "files4=@image_0029.jpg" -F "files5=@image_0030.jpg" -F "files11=@image_0036.jpg" --header "ContentType: application/x-www-form-urlencoded"   http://localhost:10001/api/reque

我从邮递员中进行了“导入”,最终转换为邮递员脚本,但 contentType 更改为“form-data”。

cURL 正在工作,但无法向邮递员发出相同的请求。

需要建议。提前致谢

【问题讨论】:

  • 它可能试图变得聪明,因为form-data 是 UI 上唯一可以附加文件的位置。

标签: curl post postman


【解决方案1】:

请试试这个

curl -X POST \
  http://localhost:10001/api/reque \
  -H 'Accept: application/vnd.aqilix.bootstrap.v1+json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F files1=@image_0026.jpg \
  -F files2=@image_0027.jpg \
  -F files3=@image_0028.jpg \
  -F files4=@image_0029.jpg \
  -F files5=@image_0030.jpg \
  -F files11=@image_0036.jpg

【讨论】:

  • 这有什么变化?
猜你喜欢
  • 2020-02-06
  • 2016-05-04
  • 1970-01-01
  • 2017-07-14
  • 1970-01-01
  • 2014-08-24
  • 2016-03-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多