MCPcopy Create free account
hub / github.com/boy-hack/hack-requests / test_post

Method test_post

tests/test_http_raw.py:30–45  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 self.assertTrue(json.loads(r.text())["args"] == {"a": "1", "b": "2", "c": "heloo"})
29
30 def test_post(self):
31 raw = '''
32POST /post HTTP/1.1
33Host: httpbin.org
34Connection: keep-alive
35Upgrade-Insecure-Requests: 1
36User-Agent: celebrate hack-requests 1.0 !
37Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
38Accept-Encoding: gzip, deflate
39Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
40Cookie: _gauges_unique_hour=1; _gauges_unique_day=1; _gauges_unique_month=1; _gauges_unique_year=1; _gauges_unique=1
41
42a=1&b=2&c=heloo
43 '''
44 r = self.hack.httpraw(raw)
45 self.assertTrue("a=1&b=2&c=heloo" in r.text())
46
47 def test_json(self):
48 raw = '''

Callers

nothing calls this directly

Calls 2

textMethod · 0.80
httprawMethod · 0.45

Tested by

no test coverage detected