python提交表单和提交json
来源:互联网 发布:软件测试课程大纲 编辑:程序博客网 时间:2024/06/16 17:55
python提交表单
#!/usr/bin/python # -*- coding:utf-8 -*- import httplib,urllib,json; def SendRedPacket(): params = urllib.urlencode({'count':'100', 'amount':'6666', }); headerdata = {"Content-type": "application/x-www-form-urlencoded; charset=UTF-8", "Cookie": "4&_token=12410&d23272107;4&_dev=iP6197F&6.3.15"} conn = httplib.HTTPConnection("mobile.test.XXXXXXX.com"); conn.request(method="POST",url="https://mobile.test.XXXXXXX.com/send",body=params,headers=headerdata); response = conn.getresponse();print("status:%d"%response.status)print("content:%s"%response.read())conn.close();
python提交json
import httplibimport cookielibdef sendRedPacket():test_data = {'count':'100','amount':'100'} requrl = "https://mobile.test.xxxxxxxxxx.com/send" headerdata = {#"Content-type": "application/json","Content-type": "application/x-www-form-urlencoded", "Cookie": "4&_token=13272107;4&_dev=iPh&6.3.15"} conn = httplib.HTTPConnection("mobile.test.xxxxxxxx.com") conn.request('POST',requrl,json.dumps(test_data),headerdata) response = conn.getresponse() res= response.read() print resconn.close();
阅读全文
0 0
- python提交表单和提交json
- json 跨域 表单提交
- 阻止表单提交和提交
- python进行表单提交
- python表单提交
- form表单提交和ajax表单提交
- form表单提交和ajax表单提交
- HTML5 JSON格式提交表单
- Jquery表单提交JSON数据
- html:表单和表单提交
- 用python模拟提交表单
- python get,post提交表单
- python get,post提交表单
- Python Flask-表单提交方式
- Python需要提交表单爬虫
- spring security的ajax提交和json返回数据--兼容form表单提交
- 表单提交(submit)和Ajax提交
- 表单提交(submit)和Ajax提交
- bdlink创建、使用、删除
- ATL与COM之间的关系、ATL的特点与基本使用方法
- iOS 时间与日期处理
- Codeforces Round #430 (Div. 2)
- Spring Cloud中,Feign常见问题总结
- python提交表单和提交json
- android studio 常用配置
- 九天学会Java,第三天,选择结构
- LinkedHashMap
- 比较各JAX-RS实现
- sudo: no valid sudoers sources found, quitting
- Map集合基础
- 数据读写分离
- 详解C++中指针(*)、取地址(&)、解引用(*)与引用(&)的区别