import faster_than_requests as requests requests.init_client() print(requests.get("http://httpbin.org/get")) # HTTP GET. print( requests.post("http://httpbin.org/post", """{"foo": "bar", "baz": true}""")) # HTTP POST. print(requests.put("http://httpbin.org/put", """{"foo": "bar", "baz": true}""")) # HTTP PUT. print(requests.delete("http://httpbin.org/delete")) # HTTP DELETE. print( requests.patch("http://httpbin.org/patch", """{"foo": "bar", "baz": true}""")) # HTTP PATCH. print(requests.get2str( "http://httpbin.org/get")) # HTTP GET body only to string response. print(requests.get2dict( "http://httpbin.org/get")) # HTTP GET body only to dictionary response. print(requests.get2json( "http://httpbin.org/get")) # HTTP GET body only to JSON response. print( requests.post2str("http://httpbin.org/post", """{"foo": "bar", "baz": true}""")
def test_put(self): self.assertIsInstance(faster_than_requests.put("http://httpbin.org/put", """{"foo": "bar", "baz": true}"""), dict)