A simple HTTP/2 client for Cyber Security
Project description
http2client
A simple HTTP/2 client for Cyber Security
Useage:
import h2.connection
import http2client
import json
config = h2.connection.H2Configuration()
config.validate_outbound_headers = False
config.validate_inbound_headers = False
config.normalize_outbound_headers = False
s = http2client.Session("httpbin.org", 443, config=config, http2_prior_knowledge=True)
body = b'0\r\n\r\nGET /404 HTTP/1.1\r\nx: x'
headers = [
(':method', 'POST'),
(':path', "/anything"),
(':authority', "httpbin.org"),
(':scheme', 'https'),
# ('User-Agent', 'testet\r\nTransfer-Encoding: chunked'),
('content-length', len(body)),
]
# If the headers is set, the url will be ignored
stream1 = s.post("https://httpbin.org", headers=headers, data=body)
stream2 = s.get("https://httpbin.org/anything")
print(json.loads(stream1.getData()))
print(json.loads(stream2.getData()))
resp = http2client.request("GET", "https://httpbin.org/anything",
http2_prior_knowledge=True,
normalize=False,
validate=False,
timeout=10
)
print(resp.getHeaders())
print(json.loads(resp.getData()))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
http2client-0.0.9.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for http2client-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f34d14cc9e51b2720b3a07caaa6b41a0314d2d385b5efb90767b6b8195f6ba7 |
|
MD5 | c62b163e7cca2b0b36c568f3e68bba00 |
|
BLAKE2b-256 | 0def02fa6510daabf360c3150249103f0ec86272e2737756645ca837fd5c2e89 |