swaggerpy.http_client module
HTTP client abstractions.
- class swaggerpy.http_client.ApiKeyAuthenticator(host, api_key, param_name='api_key')[source]
Bases:
Authenticator
?api_key authenticator.
This authenticator adds a query parameter to specify an API key.
- Parameters
host – Host to authenticate for.
api_key – API key.
param_name – Query parameter specifying the API key.
- class swaggerpy.http_client.Authenticator(host)[source]
Bases:
object
Authenticates requests.
- Parameters
host – Host to authenticate for.
- class swaggerpy.http_client.BasicAuthenticator(host, username, password)[source]
Bases:
Authenticator
HTTP Basic authenticator.
- Parameters
host – Host to authenticate for.
username – Username.
password – Password
- class swaggerpy.http_client.HttpClient[source]
Bases:
object
Interface for a minimal HTTP client.
- set_api_key(host, api_key, param_name='api_key')[source]
Configures client to use api_key authentication.
The api_key is added to every query parameter sent.
- Parameters
host – Hostname to limit authentication to.
api_key – Value for api_key.
param_name – Parameter name to use in query string.
- class swaggerpy.http_client.SynchronousHttpClient[source]
Bases:
HttpClient
Synchronous HTTP client implementation.
- request(method, url, params=None, data=None, headers=None)[source]
Requests based implementation.
- Returns
Requests response
- Return type
requests.Response
- set_api_key(host, api_key, param_name='api_key')[source]
Configures client to use api_key authentication.
The api_key is added to every query parameter sent.
- Parameters
host – Hostname to limit authentication to.
api_key – Value for api_key.
param_name – Parameter name to use in query string.