发送multipart / form-data请求的工具[关闭]

本文翻译自:Tool for sending multipart/form-data request [closed]

I am currently using the Chrome Addon Postman - REST Client to easily create POST / GET request. 我目前正在使用Chrome Addon Postman - REST客户端轻松创建POST / GET请求。

Now I want to debug an upload script and I am looking for a tool to make requests encoded as "multipart/form-data" so that I can send also a file. 现在我想调试上传脚本,我正在寻找一个工具来将请求编码为“multipart / form-data”,这样我也可以发送一个文件。


#1楼

参考:https://stackoom.com/question/15CNI/发送multipart-form-data请求的工具-关闭


#2楼

UPDATE: I have created a video on sending multipart/form-data requests to explain this better. 更新:我已经创建了一个关于发送multipart / form-data请求视频来更好地解释这个问题。


Actually, Postman can do this. 实际上, 邮差可以做到这一点。 Here is a screenshot 这是一个截图

Newer version : Screenshot captured from postman chrome extension 较新版本 :从postman chrome扩展程序中捕获的屏幕截图 在此输入图像描述

Another version 另一个版本

在此输入图像描述

Older version 旧版本

在此输入图像描述

Make sure you check the comment from @maxkoryukov 请务必查看@maxkoryukov的评论

Be careful with explicit Content-Type header. 注意显式的Content-Type标头。 Better - do not set it's value, the Postman is smart enough to fill this header for you. 更好 - 不要设置它的价值,Postman足够聪明,可以为你填充这个标题。 BUT, if you want to set the Content-Type: multipart/form-data - do not forget about boundary field . 但是,如果要设置Content-Type:multipart / form-data,请不要忘记边界字段


#3楼

The usual error is one tries to put Content-Type: {multipart/form-data} into the header of the post request. 通常的错误是尝试将Content-Type: {multipart/form-data}放入post请求的标头中。 That will fail, it is best to let Postman do it for you. 那会失败,最好让邮差为你做。 For example: 例如:

Suggestion To Load Via Postman 建议通过Postman加载 身体的一部分

Fails If In Header 如果在标题中失败 常见错误

Works 作品 应该从标题中删除内容类型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值