Python(20):发送GET请求、POST请求
来源:互联网 发布:最好的域名注册商 编辑:程序博客网 时间:2024/06/06 02:05
在Python3下,用urllib发起GET请求或POST请求
# -*- coding: utf-8 -*-"""Created on Mon Aug 7 10:20:09 2017@author: qcy"""from urllib.request import urlopenimport json# GETurl = 'http://127.0.0.1:8889'content = {'a':3,'s':4}data_json = json.dumps(content)print(data_json)web = urlopen(url, bytes(data_json,encoding='utf-8'))rawtext = web.read()sss = rawtext.decode('utf8')print(sss)# POSTurl = 'http://127.0.0.1:8889?name=qcy&age=24'web = urlopen(url)rawtext = web.read()sss = rawtext.decode('utf8')print(sss)
阅读全文
0 0
- Python(20):发送GET请求、POST请求
- Python发送get,post请求
- Python发送GET和POST请求
- python发送post和get请求
- python发送get/post/put/delete请求
- PHP发送HTTP请求(POST请求、GET请求)
- python 使用urllib2发送get请求和post请求
- python post/get 请求
- C#发送Web请求(GET/POST)
- python发送post请求
- python发送post请求
- python 发送post请求
- python发送get请求
- Java发送Get/Post请求
- IOS发送POST/GET请求
- ajax发送get、post请求
- ajax发送get、post请求
- Java发送GET,POST请求
- Youtube下载
- 安卓异常之java.lang.IllegalArgumentException: Must use a native order direct Buffer
- MySQL基础入门—SELECT语句详解
- 三种素数筛选法详解 (转)
- WebStorm出现404问题
- Python(20):发送GET请求、POST请求
- 浮点数的比较
- jquery 写个滚动自动加载插件
- 前i位可被i整除的9位无重复数字的整数
- OpenGL中的颜色再次讨论
- Java字符串处理工具
- OpenGL鼠标拾取
- CentOS使用YUM安装php运行环境,包含php,php-fpm,nginx,mysql
- ZOJ 3475 The Great Wall I【最大流最小割定理+巧妙建图】