企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
#### GET ``` http = urllib3.PoolManager() header = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36' } res = http.request("GET", "http://www.baidu.com/s?", fields={'wd':'hello'}, headers=header) print(res.status) print(res.data.decode()) ``` #### POST ``` http = urllib3.PoolManager() header = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36' } res = http.request("POST", "http://www.baidu.com/s?", fields={'wd':'hello'}, headers=header) print(res.status) print(res.data.decode()) ```