zoukankan      html  css  js  c++  java
  • 响应

    1 #响应类型                                                     
    2 import urllib.request                                     
    3 response = urllib.request.urlopen('http://www.baidu.com') 
    4 print(type(response))                                     
    5 <class 'http.client.HTTPResponse'>#得到一个http响应             
    1 #状态码,响应头 ,响应主体                                
    2 import urllib.request                    
    3                                          
    4 response = urllib.request.urlopen('http:/
    5 print(response.status)#状态码               
    6 print(response.getheaders())#响应头         
    7 print(response.read().decode('utf-8'))   响应体
  • 相关阅读:
    HDU 3537
    POJ 1175
    POJ 1021 人品题
    POJ 2068
    POJ 2608
    POJ 2960
    poj 1635
    ustc 1117
    ural 1468
    数字游戏
  • 原文地址:https://www.cnblogs.com/themost/p/6837603.html
Copyright © 2011-2022 走看看