pyceo/ceo_common/interfaces/IHTTPClient.py

25 lines
789 B
Python

from zope.interface import Interface
class IHTTPClient(Interface):
"""A helper class for HTTP requests to ceod."""
def request(host: str, api_path: str, method: str, delegate: bool, **kwargs):
"""
Make an HTTP request.
If `delegate` is True, GSSAPI credentials will be forwarded to the
remote.
"""
def get(host: str, api_path: str, delegate: bool = True, **kwargs):
"""Make a GET request."""
def post(host: str, api_path: str, delegate: bool = True, **kwargs):
"""Make a POST request."""
def patch(host: str, api_path: str, delegate: bool = True, **kwargs):
"""Make a PATCH request."""
def delete(host: str, api_path: str, delegate: bool = True, **kwargs):
"""Make a DELETE request."""