mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 23:28:33 -04:00
19 lines
388 B
Python
Executable File
19 lines
388 B
Python
Executable File
import http.client
|
|
|
|
conn = http.client.HTTPConnection("mockbin.com")
|
|
|
|
payload = "foo=bar"
|
|
|
|
headers = {
|
|
'cookie': "foo=bar; bar=baz",
|
|
'accept': "application/json",
|
|
'content-type': "application/x-www-form-urlencoded"
|
|
}
|
|
|
|
conn.request("POST", "/har?foo=bar&foo=baz&baz=abc&key=value", payload, headers)
|
|
|
|
res = conn.getresponse()
|
|
data = res.read()
|
|
|
|
print(data.decode("utf-8"))
|