pip install httplib2 python import httplib2 http = httplib2.Http() response, content = http.request("https://api.example.com/data", method="GET") python import httplib2 http = httplib2.Http() response, content = http.request("https://api.example.com/data", method="GET") for header, value in response.items(): print(header, ":", value) python import httplib2 http = httplib2.Http() http.add_credentials("username", "password") http.add_header("Custom-Header", "Custom Value") response, content = http.request("https://api.example.com/data", method="GET") python import httplib2 http = httplib2.Http(proxy_info=httplib2.ProxyInfo( proxy_type=httplib2.socks.PROXY_TYPE_HTTP, proxy_host="proxy.example.com", proxy_port=8080, proxy_user="username", proxy_pass="password" )) response, content = http.request("https://api.example.com/data", method="GET")


上一篇:
下一篇:
切换中文