ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的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()) ```