Python HTTP 库 httplib2

码农软件 · 软件分类 · 高性能网络开发库 · 2019-09-02 05:59:23

软件介绍

httplib2是一个使用python写的支持的非常全面的http特性的库。需要Python2.3或更高版本的运行环境,0.5.0版及其以后包含了对Python3的支持。

简单的例子:

 

import httplib2
h = httplib2.Http(".cache")
resp, content = h.request("http://example.org/", "GET")

 

认证实例:

 

 

import httplib2
h = httplib2.Http(".cache")
h.add_credentials('name', 'password')
resp, content = h.request("https://example.org/chap/2", 
    "PUT", body="This is text", 
    headers={'content-type':'text/plain'} )

 

缓存控制:

 

 

import httplib2
h = httplib2.Http(".cache")
resp, content = h.request("http://bitworking.org/")
 ...
resp, content = h.request("http://bitworking.org/", 
    headers={'cache-control':'no-cache'})

 

本文地址:https://codercto.com/soft/d/13684.html

The Science of Programming

The Science of Programming

David Gries / Springer / 1989-4-21 / USD 99.00

Describes basic programming principles and their step-by- step applications.Numerous examples are included.一起来看看 《The Science of Programming》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具