Python3 21.6. urllib.request 常用方法中文翻译(自翻)
来源:互联网 发布:淘宝免邮还有利润吗 编辑:程序博客网 时间:2024/06/05 17:46
request 是一个帮助打开url(大多数为http)的方法.
The urllib.request module defines the following functions:
urllib.request 定义了以下的方法:
urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capath=None, cadefault=False, context=None)
参数:
- url:目标路径 可以使str或者是request对象
- data[默认为None]:指定的额外发送给server的data对象.如果没有这样的data要求,则为None
- timeout[可选参数]:明确阻塞操作(比如connection attempt)的超时时间.如果没明确,则会使用全局默认超时间,该参数实际只在HTTP, HTTPS and FTP 连接中有效.
- context[默认为None]:必须是 ssl.SSLContext的实例
- cafile[默认为None]:和capath 指定了HTTPS requests的可信任CA证书.指向了一个包含一捆CA证书的文件
- capath[默认为None]:指向了可信任CA证书的目录或hash .
- cadefault:该参数被忽略了……
urllib.request模块使用的 HTTP/1.1
This function always returns an object which can work as a context manager and has methods such as
该方法总是返回一个能作为context manager的对象,并且有以下操作:
- geturl() — 返回一个资源检索的URL,一般被用来判断是否存在重定向.
- info() — 返回页面的meta信息
- getcode() – return the HTTP status code of the response.返回返回的http状态码,如果返回200表示请求成功
- Python3 21.6. urllib.request 常用方法中文翻译(自翻)
- python3 urllib.request
- Python3:urllib.request详解
- python3 标准库 urllib.request
- Python3: urllib.request 的使用
- python 自带urllib.request 模块简单介绍(python3.5)
- Urllib.request用法简单介绍(Python3.3)
- python3.3中urllib.request.open问题
- python3 urllib.request抓资源的方式
- python3 urllib.request 按行处理
- python3的urllib的request模块
- Python3中urllib.request.retrieve的使用
- python3 urllib.request 网络请求操作
- Python3的urllib.parse常用函数小结
- python3 学习笔记之 urllib.request《一》 (urllib2 in python2)
- python3 学习笔记之 urllib.request《二》 (urllib2 in python2)
- Python2 urllib2 与 Python3 urllib.request API对照
- python3.x的urllib.request哪去了?
- Java 实现最大堆
- SVN常见命令的使用
- hadoop学习7
- python 实现GUI(图形用户界面)编程
- 【剑指Offer】树的子结构
- Python3 21.6. urllib.request 常用方法中文翻译(自翻)
- 密码生成
- 【oracle】表的创建与管理
- 第二周项目 2—C/C++语言中函数参数传递的三种方式
- spring-mvc拦截器使用
- 关于Tomact接口被占用的问题解决
- 基础排序算法–冒泡排序、选择排序和插入排序
- taskscheduler 引发了异常
- PAT甲级 1007