概述
实践
代码
from urllib.parse import urlparse
import urllib3
pool_manager = urllib3.PoolManager()
test_url = "http://10.32.44.103:9999/process-business/qan/page?page=1&size=5"
parsed = urlparse(test_url)
req_url = parsed.geturl()
conn = pool_manager.connection_from_url(req_url)
resp = conn.urlopen("GET", test_url)
print("请求状态码={},请求结果={}".format(resp.status, resp.data))
执行结果
代码
from urllib.parse import urlparse
import urllib3
pool_manager = urllib3.PoolManager()
test_url = "http://10.32.44.103:9999/process-business/qan/page?page=1&size=5"
parsed = urlparse(test_url)
req_url = parsed.geturl()
conn = pool_manager.connection_from_url(req_url)
resp = conn.urlopen("GET", test_url)
print("请求状态码={},请求结果={}".format(resp.status, resp.data))
import requests
response = requests.get(test_url)
print("请求状态码={},请求结果={}".format(response.status_code, response.text))
结果
官网文档
第三插件搜索