在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:encode/httpcore开源软件地址:https://github.com/encode/httpcore开源编程语言:Python 99.2%开源软件介绍:HTTP Core
The HTTP Core package provides a minimal low-level HTTP client, which does one thing only. Sending HTTP requests. It does not provide any high level model abstractions over the API, does not handle redirects, multipart uploads, building authentication headers, transparent HTTP caching, URL parsing, session cookie handling, content or charset decoding, handling JSON, environment based configuration defaults, or any of that Jazz. Some things HTTP Core does do:
RequirementsPython 3.7+ InstallationFor HTTP/1.1 only support, install with: $ pip install httpcore For HTTP/1.1 and HTTP/2 support, install with: $ pip install httpcore[http2] For SOCKS proxy support, install with: $ pip install httpcore[socks] Sending requestsSend an HTTP request: import httpcore
response = httpcore.request("GET", "https://www.example.com/")
print(response)
# <Response [200]>
print(response.status)
# 200
print(response.headers)
# [(b'Accept-Ranges', b'bytes'), (b'Age', b'557328'), (b'Cache-Control', b'max-age=604800'), ...]
print(response.content)
# b'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>\n\n<meta charset="utf-8"/>\n ...' The top-level import httpcore
http = httpcore.ConnectionPool()
response = http.request("GET", "https://www.example.com/") Once you're ready to get going, head over to the documentation. MotivationYou probably don't want to be using HTTP Core directly. It might make sense if
you're writing something like a proxy service in Python, and you just want
something at the lowest possible level, but more typically you'll want to use
a higher level client library, such as The motivation for
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论