pyneric.requests¶
Helpers for the requests library.
-
pyneric.requests.SUPPORTED_METHODS= (Method(token='GET', description='Transfer a current representation of the target resource.', safe=True, idempotent=True, cacheable=True), Method(token='OPTIONS', description='Describe the communication options for the target resource.', safe=True, idempotent=True, cacheable=False), Method(token='HEAD', description='Same as GET, but only transfer the status line and header section.', safe=True, idempotent=True, cacheable=True), Method(token='POST', description='Perform resource-specific processing on the request payload.', safe=False, idempotent=False, cacheable=True), Method(token='PUT', description='Replace all current representations of the target resource with the request payload.', safe=False, idempotent=True, cacheable=False), Method(token='PATCH', description='Modify the target resource with the request payload.', safe=False, idempotent=False, cacheable=False), Method(token='DELETE', description='Remove all current representations of the target resource.', safe=False, idempotent=True, cacheable=False))¶ The HTTP methods supported by
requestsas functions.These are also exposed as methods in
RequestHandler.
-
class
pyneric.requests.RequestHandler[source]¶ Bases:
objectBase class for handlers of request calls.
-
request(method, url, **kwargs)[source]¶ Make an HTTP request using
requests.request.Parameters: Returns: result of the request
Return type: dependent on implementation;
Responseby defaultThis can be overridden in a subclass, but the most common use case is to extend it.
-