Python 学习笔记 101

python http 模组

http is a package that collects several modules for working with the HyperText Transfer Protocol:

    http.client is a low-level HTTP protocol client; for high-level URL opening use urllib.request
    http.server contains basic HTTP server classes based on socketserver
    http.cookies has utilities for implementing state management with cookies
    http.cookiejar provides persistence of cookies

1.HyperText Transfer Protocol: http协议 超链接文本传输协议 (自己看懂的,应该就是这样的!)
2.http.client 低级http协议客户端
高级使用urllib.request
3.http.server包含基于socketserver的基本HTTP服务器类
没看懂 pass
4.下面是关于cookies的一些介绍 关于cookies的持久性&一些常见组件

http is also a module that defines a number of HTTP status codes and associated messages through the http.HTTPStatus enum:

5.定义了http返回的状态码:

code:
from http import HTTPStatus

HTTPStatus.ACCEPTED

http客户端编程一般用urllib.request库

主要用于“在这复杂的世界里打开各种url”,包括:authentication、redirections、cookies and more

http库中的函数

urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capath=None, cadefault=False, context=None)     

urllib.request.install_opener(opener)     

urllib.request.build_opener([handler, ...])     

urllib.request.pathname2url(path)        

urllib.request.url2pathname(path)    

urllib.request.getproxies()    

未完待续
2020年1月19日21:58:10

全部评论

相关推荐

秋招投简历提醒助手:个人经验是,一般面二十场左右就会进入侃侃而谈阶段。我今年七月末的时候开始的第一次面试,都是很多不会,回复很慢。后面慢慢迭代,到九月中的时候基本上面啥说啥,很放松的状态
远程面试的尴尬瞬间
点赞 评论 收藏
分享
12-24 20:46
武汉大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务