9q13nh 发表于 2024-11-2 15:21:00

「按键精灵安卓版」「基本知识」按键post基本写法


    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">大众</span>好,我是公众号3分钟学堂的郭立员~</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这一期<span style="color: black;">咱们</span>来讲按键post的写法,<span style="color: black;">期盼</span><span style="color: black;">经过</span>本期的学习,实现<span style="color: black;">平常</span>的post提交都能编写。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">下面<span style="color: black;">起始</span>讲解:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">1、</span><span style="color: black;">运用</span>的命令:url.httppost</strong></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">选择</span>这个命令的理由是它的参数比较全。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">2、</span>post请求都有<span style="color: black;">那些</span>参数(可能用到,并未<span style="color: black;">所有</span>)</strong></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">①url 提交请求的网址</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">②请求数据:post的核心参数,<span style="color: black;">便是</span>要把什么数据发给服务器</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">③header 协议头,协议头里面的参数:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Content-Type:内容类型</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">charset:编码</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">User-Agent:设备信息、用户代理,用来伪装成浏览器<span style="color: black;">或</span>其他</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">④cookie:我理解<span style="color: black;">便是</span>缓存,把<span style="color: black;">有些</span>数据存在本地,就像<span style="color: black;">咱们</span>登录网站,<span style="color: black;">第1</span>次登录后,第二次打开网站<span style="color: black;">发掘</span>自动登录,这个就和cookie<span style="color: black;">相关</span>。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">常用的参数就这些,我写post请求的时候并不是都写上,<span style="color: black;">按照</span><span style="color: black;">区别</span>的项目,能省略的我就省略了。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">3、</span>脚本执行post的<span style="color: black;">区别</span>类型</strong></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">①对接指定api,这种post请求<span style="color: black;">按照</span>api文档的<span style="color: black;">需求</span>去写,需要什么参数就写什么参数,<span style="color: black;">一般</span>这种类型,会有部分参数<span style="color: black;">能够</span>省略。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">②协议抓包,<span style="color: black;">经过</span>抓包工具获取到的post数据,这种类型的post请求需要把所有参数都填上。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">4、</span>写post请求的脚本<span style="color: black;">重视</span>事项</strong></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">请求数据的类型,脚本<span style="color: black;">平常</span>的类型有3个类型</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">提交字符串、提交表、提交json</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">详细</span>提交什么类型<span style="color: black;">按照</span>Content-Type来定,<span style="color: black;">例如</span></span></p>Content-Type application/json<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这个就是提交json格式,这一点非常重要,<span style="color: black;">倘若</span>选错类型,即使数据是对了,提交<span style="color: black;">亦</span>不会成功。</span></p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/55bee4c939b241ee96e60e82cd56b6bc~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1729807757&amp;x-signature=9FOtDcx090o1Zv7mVdUTz18H1bU%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">提交的类型还有<span style="color: black;">非常多</span>,<span style="color: black;">重视</span>别填错了。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">5、</span>post请求的代码展示</strong></span></p>Dim uri = <span style="color: black;">"网址"</span>
    Dim <span style="color: black;">data</span> = <span style="color: black;">""</span> <span style="color: black;">//参数格式<span style="color: black;">按照</span>Content-Type来定</span>
    Dim header ={<span style="color: black;">"User-Agent"</span>:<span style="color: black;">"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 "</span>, <span style="color: black;">"Content-Type"</span>:<span style="color: black;">"application/json"</span>}
    Dim cookie=<span style="color: black;">""</span>
    Dim ret = Url.HttpPost({<span style="color: black;">"url"</span>:uri,<span style="color: black;">"data"</span>:<span style="color: black;">data</span>,<span style="color: black;">"code"</span>:<span style="color: black;">"UTF-8"</span>, <span style="color: black;">"cookie"</span>:cookie, <span style="color: black;">"header"</span>:header})
    TracePrint ret<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这个模板<span style="color: black;">能够</span>直接套用,大部分post请求都能完成。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">为了防止<span style="color: black;">由于</span>书写错误<span style="color: black;">引起</span>脚本的post请求<span style="color: black;">不可</span>正常运行,<span style="color: black;">咱们</span>还<span style="color: black;">能够</span><span style="color: black;">经过</span>在线post测试工具,测试<span style="color: black;">咱们</span>提交的数据<span style="color: black;">是不是</span>正确。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">https://post.jsonin.com/</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">http://coolaf.com/</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">https://www.sojson.com/http/test.html</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这些网站都<span style="color: black;">能够</span>,在测试成功完毕后,再去写脚本心里就有底了。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">本期<span style="color: black;">文案</span>没写<span style="color: black;">详细</span>的例子,<span style="color: black;">举荐</span>一下往期<span style="color: black;">关联</span>的<span style="color: black;">文案</span>:</strong></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">[按键精灵][协议抓包]抓取某人<span style="color: black;">博客</span>的内容</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">[按键精灵]伪装成浏览器采集网页数据</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">pushplus<span style="color: black;">信息</span>推送做脚本提醒功能</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">=正文完=</span></p>




7wu1wm0 发表于 2024-11-12 21:17:27

论坛的成果是显著的,但我们不能因为成绩而沾沾自喜。

m5k1umn 发表于 2024-11-12 23:39:32

楼主听话,多发外链好处多,快到碗里来!外链论坛 http://www.fok120.com/
页: [1]
查看完整版本: 「按键精灵安卓版」「基本知识」按键post基本写法