|
6精币
变量名 | 类 型 | 静态 | 数组 | 备 注 | 局_网址 | 文本型 | | | 局_方式 | 整数型 | | | 局_提交数据 | 文本型 | | | 局_提交cookie | 文本型 | | | ADD_协议头 | 类_POST数据类 | | | 局_提交协议头 | 文本型 | | | 局_结果 | 字节集 | | | 局_返回 | 文本型 | | |
局_网址 = "https://widget.weibo.com/public/aj_uploadpic.php" 局_方式 = 1 Content-Disposition: form-data; name="pic"; filename="123.jpg" Content-Type: image/jpeg ?? 局_提交数据 = "-----------------------------7e821b2d9045c” + #换行符 + “Content-Disposition: form-data; name=”+#引号+ “pic”+#引号+ “; filename=”+#引号+ “123.jpg”+#引号+ “” + #换行符 + “Content-Type: image/jpeg” + #换行符 + “” + #换行符 + “??" 局_提交数据 = 编码_gb2312到utf8 (局_提交数据) 局_提交cookie = "SINAGLOBAL=435413694611.0715.1724836680711; ALF=1727413635; ULV=1724895461964:5:5:5:4694558420773.226.1724895461627:1724844360235; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WhTZlmJkN0oDWOl8GWY47TU5JpX5KzhUgL.FoM4Sh-RSo54ShB2dJLoIp7LxKML1KBLBKnLxKqL1hnLBoMX1hzpSoeX1K27; SUB=_2A25LysDTDeRhGeFH71cZ9i7FzziIHXVoplwbrDV8PUJbkNANLXjnkW1NeyXUzWGvssBmw5bhMHpim0CnswEtfk-x; _s_tentry=-; Apache=4694558420773.226.1724895461627" ADD_协议头.添加 ("Accept","image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */*") ADD_协议头.添加 ("Referer","https://widget.weibo.com/topics/topic_vote_base.php?top_mblog=z8ClGsZa8&og=https%3A%2F%2Fopen.weibo.com%2Fwidget%2Fweibotopic.php&tag=%E5%A5%BD%E7%94%A8%E5%90%97&isshowright=1&uid=1904178193&language=zh_cn&height=599&width=821&dup=0&antispam=0&isOutTopicSearch=0&border=0&version=base&footbar=0&rnd=62042") ADD_协议头.添加 ("Accept-Language","zh-CN") ADD_协议头.添加 ("Content-Type","multipart/form-data; boundary=---------------------------7e821b2d9045c") ADD_协议头.添加 ("User-Agent","Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko") ADD_协议头.添加 ("Host","widget.weibo.com") ADD_协议头.添加 ("Content-Length","33671") ADD_协议头.添加 ("Connection","Keep-Alive") ADD_协议头.添加 ("Cache-Control","no-cache") ADD_协议头.添加 ("Cookie","SINAGLOBAL=435413694611.0715.1724836680711; ALF=1727413635; ULV=1724895461964:5:5:5:4694558420773.226.1724895461627:1724844360235; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WhTZlmJkN0oDWOl8GWY47TU5JpX5KzhUgL.FoM4Sh-RSo54ShB2dJLoIp7LxKML1KBLBKnLxKqL1hnLBoMX1hzpSoeX1K27; SUB=_2A25LysDTDeRhGeFH71cZ9i7FzziIHXVoplwbrDV8PUJbkNANLXjnkW1NeyXUzWGvssBmw5bhMHpim0CnswEtfk-x; _s_tentry=-; Apache=4694558420773.226.1724895461627") 局_提交协议头 = ADD_协议头.获取协议头数据 () 局_结果 = 网页_访问_对象 (局_网址, 局_方式, , 局_提交Cookie, , 局_提交协议头, , , , 到字节集 (局_提交数据), , , , , , , ) 局_返回 = 到文本(局_结果) 返回 (局_返回)
直接发送返回 错误应该怎么弄
补充内容 (2024-8-29 09:45):
返回{"code":"100013","msg":"请上传小于5M的gif、jpg、png图片"} |
最佳答案
查看完整内容
很明显,你的文件就没弄进去,那个方坨坨就是乱码了 ,你要组装的时候就用字节集才行
局_提交数 据 改变为字节集
局_提交数 据 =到字节集( "-----------------------------7e821b2d9045c” + #换行符 + “Content-Disposition: form-data; name=”+#引号+“pic”+#引号+“; filename=”+#引号+“123.jpg”+#引号+“” + #换行符 + “Content-Type: image/jpeg” + #换行符 + “” + #换行符 )+ 图像字节集 + 到字节集 ...
|