首页 > Requests 库能不能自定义 boundary

Requests 库能不能自定义 boundary

Requests 库默认发送 multipart 是自动在头和消息体中加入 boundary 的但是它自动生成的头里没有 chareset=utf-8 ,因此造成中文编码问题
虽然 Requests 库支持自定义头,可以在 Content-type 里加入 chareset 和 boundary ,但是在消息体里面加 boundary 怎么实现?找了半天网上也米有相关信息……


建议使用urllib2库,可以自定义header。

【热门文章】
【热门文章】