All Projects → httplib2 → Httplib2

httplib2 / Httplib2

Licence: other
Small, fast HTTP client library for Python. Features persistent connections, cache, and Google App Engine support. Originally written by Joe Gregorio, now supported by community.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Httplib2

Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+734.58%)
Mutual labels:  network, http-client
Sylar
C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
Stars: ✭ 895 (+122.64%)
Mutual labels:  network, http-client
Fast Android Networking
🚀 A Complete Fast Android Networking Library that also supports HTTP/2 🚀
Stars: ✭ 5,346 (+1229.85%)
Mutual labels:  network, http-client
Oh My Request
🔮 simple request library by java8
Stars: ✭ 44 (-89.05%)
Mutual labels:  network, http-client
Qtnetworkng
QtNetwork Next Generation. A coroutine based network framework for Qt/C++, with more simpler API than boost::asio.
Stars: ✭ 125 (-68.91%)
Mutual labels:  network, http-client
Hreq
A type dependent highlevel HTTP client library inspired by servant-client.
Stars: ✭ 53 (-86.82%)
Mutual labels:  network, http-client
Easygo
基于Kotlin、OkHttp的声明式网络框架,像写HTML界面一样写网络调用代码
Stars: ✭ 40 (-90.05%)
Mutual labels:  network, http-client
Curlsharp
CurlSharp - .Net binding and object-oriented wrapper for libcurl.
Stars: ✭ 153 (-61.94%)
Mutual labels:  network, http-client
Grab
Web Scraping Framework
Stars: ✭ 2,147 (+434.08%)
Mutual labels:  network, http-client
Game Networking Resources
A Curated List of Game Network Programming Resources
Stars: ✭ 4,208 (+946.77%)
Mutual labels:  network
Bgpalerter
Software to monitor streams of BGP data. Pre-configured for real-time detection of visibility loss, RPKI invalid announcements, hijacks, and more.
Stars: ✭ 367 (-8.71%)
Mutual labels:  network
Tcping
ping over a tcp connection
Stars: ✭ 346 (-13.93%)
Mutual labels:  network
Jodd
Jodd! Lightweight. Java. Zero dependencies. Use what you like.
Stars: ✭ 3,616 (+799.5%)
Mutual labels:  http-client
Cs Wiki
🎉 致力打造完善的 Java 后端知识体系,不仅仅帮助各位小伙伴快速且系统的准备面试,更指引学习的方向
Stars: ✭ 369 (-8.21%)
Mutual labels:  network
Coderyi.github.io
Don't fork! coderyi's blog,about iOS ,CS and my code life.
Stars: ✭ 349 (-13.18%)
Mutual labels:  network
Stats
macOS system monitor in your menu bar
Stars: ✭ 7,134 (+1674.63%)
Mutual labels:  network
Mjdownload
A delightful framework for multifile resumable broken downloads.
Stars: ✭ 345 (-14.18%)
Mutual labels:  network
Fpga Network Stack
Scalable Network Stack for FPGAs (TCP/IP, RoCEv2)
Stars: ✭ 345 (-14.18%)
Mutual labels:  network
Bagel
a little native network debugging tool for iOS
Stars: ✭ 4,005 (+896.27%)
Mutual labels:  network
Ceras
Universal binary serializer for a wide variety of scenarios https://discord.gg/FGaCX4c
Stars: ✭ 374 (-6.97%)
Mutual labels:  network

Introduction

httplib2 is a comprehensive HTTP client library, httplib2.py supports many features left out of other HTTP libraries.

HTTP and HTTPS

HTTPS support is only available if the socket module was compiled with SSL support.

Keep-Alive

Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible.

Authentication

The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS.

  • Digest
  • Basic
  • WSSE

Caching

The module can optionally operate with a private cache that understands the Cache-Control: header and uses both the ETag and Last-Modified cache validators.

All Methods

The module can handle any HTTP request method, not just GET and POST.

Redirects

Automatically follows 3XX redirects on GETs.

Compression

Handles both 'deflate' and 'gzip' types of compression.

Lost update support

Automatically adds back ETags into PUT requests to resources we have already cached. This implements Section 3.2 of Detecting the Lost Update Problem Using Unreserved Checkout.

Unit Tested

A large and growing set of unit tests.

Installation

$ pip install httplib2

Usage

A simple retrieval:

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

The 'content' is the content retrieved from the URL. The content is already decompressed or unzipped if necessary.

To PUT some content to a server that uses SSL and Basic authentication:

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

Use the Cache-Control: header to control how the caching operates.

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

The first request will be cached and since this is a request to bitworking.org it will be set to be cached for two hours, because that is how I have my server configured. Any subsequent GET to that URI will return the value from the on-disk cache and no request will be made to the server. You can use the Cache-Control: header to change the caches behavior and in this example the second request adds the Cache-Control: header with a value of 'no-cache' which tells the library that the cached copy must not be used when handling this request.

More example usage can be found at:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].