ServiceClient Class
REST Service Client. Maintains client pipeline and handles all requests and responses.
- Inheritance
-
msrest.service_client._ServiceClientCoreServiceClient
Constructor
ServiceClient(creds: Any, config: Configuration)
Parameters
- creds
Deprecated, will be removed in next major version. Creds are now read from config.credentials.
Methods
| add_header |
Add a persistent header - this header will be applied to all requests sent during the current client session. Deprecated since version 0.5.0: Use config.headers instead |
| close |
Close the pipeline if keep_alive is True. |
| send |
Prepare and send request object according to configuration. |
| send_formdata |
Send data as a multipart form-data request. We only deal with file-like objects or strings at this point. The requests is not yet streamed. This method is deprecated, and shouldn't be used anymore. |
| stream_download |
Generator for streaming request body data. |
add_header
Add a persistent header - this header will be applied to all requests sent during the current client session.
Deprecated since version 0.5.0: Use config.headers instead
add_header(header: str, value: str) -> None
Parameters
close
Close the pipeline if keep_alive is True.
close() -> None
send
Prepare and send request object according to configuration.
send(request, headers=None, content=None, **kwargs)
Parameters
- content
Any body data to add to the request.
- config
Any specific config overrides
send_formdata
Send data as a multipart form-data request. We only deal with file-like objects or strings at this point. The requests is not yet streamed.
This method is deprecated, and shouldn't be used anymore.
send_formdata(request, headers=None, content=None, **config)
Parameters
- config
Any specific config overrides.
stream_download
Generator for streaming request body data.
stream_download(data: Union[requests.Response, ClientResponse], callback: Callable) -> Iterator[bytes]
Parameters
- data
A response object to be streamed.
- callback
Custom callback for monitoring progress.
Feedback
Submit and view feedback for