标题:http post multipart/form-data(解决)
只看楼主
radiofan
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:11
帖 子:466
专家分:696
注 册:2006-7-30
结帖率:76.47%
 问题点数:0 回复次数:4 
http post multipart/form-data(解决)
Http = CreateObject("MSXML2.XMLHttp")
Http.Open("Post","https://xxx.api",.F.)
Http.setRequestHeader("Content-Type","multipart/form-data;boundary=123456789")

lcpost = '--123456789'+chr(13)+chr(10)
lcpost = lcpost +'Content-Disposition: form-data; name="doc_title"'+chr(13)+chr(10)+chr(13)+chr(10)

lcpost = lcpost +'001'+chr(13)+chr(10)
lcpost = lcpost +'--123456789'+chr(13)+chr(10)
lcpost = lcpost +'Content-Disposition: form-data; name="doc_type"'+chr(13)+chr(10)+chr(13)+chr(10)

lcpost = lcpost +'1'+chr(13)+chr(10)
lcpost = lcpost +'--123456789--'+chr(13)+chr(10)

Http.send(lcpost)
cfhxx = Http.ResponseText

[此贴子已经被作者于2020-11-6 16:54编辑过]

搜索更多相关主题的帖子: send http post name api 
2020-11-03 15:34
wengjl
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:108
帖 子:2175
专家分:3785
注 册:2007-4-27
得分:0 
恭喜

只求每天有一丁点儿的进步就可以了
2020-11-05 08:42
ewigsmile
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-11-17
得分:0 
楼主怎样解决的,我也碰到同样的问题,以二进制发送图片显示为空
2020-11-18 16:38
radiofan
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:11
帖 子:466
专家分:696
注 册:2006-7-30
得分:0 
回复 3楼 ewigsmile
https://bbs.bccn.net/thread-503793-1-1.html 看这个
2020-11-18 21:25
plsword
Rank: 2
等 级:论坛游民
威 望:1
帖 子:21
专家分:24
注 册:2015-10-19
得分:0 
请教楼主 怎么发二进文件呢?
2021-08-31 16:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-503739-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.386049 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved