HttpTransport Class

An http sender ABC.

Inheritance
HttpTransport
HttpTransport
HttpTransport

Constructor

HttpTransport()

Methods

close

Close the session if it is not externally owned.

open

Assign new session if one does not already exist.

send

Send the request using this HTTP sender.

sleep

Sleep for the specified duration.

You should always ask the transport to sleep, and not call directly the stdlib. This is mostly important in async, as the transport may not use asyncio but other implementations like trio and they have their own way to sleep, but to keep design consistent, it's cleaner to always ask the transport to sleep and let the transport implementor decide how to do it.

close

Close the session if it is not externally owned.

abstract close() -> None

open

Assign new session if one does not already exist.

abstract open() -> None

send

Send the request using this HTTP sender.

abstract send(request: HTTPRequestType, **kwargs: Any) -> HTTPResponseType

Parameters

Name Description
request
Required
<xref:azure.core.transport.HTTPRequest>

The pipeline request object

Returns

Type Description

The pipeline response object.

sleep

Sleep for the specified duration.

You should always ask the transport to sleep, and not call directly the stdlib. This is mostly important in async, as the transport may not use asyncio but other implementations like trio and they have their own way to sleep, but to keep design consistent, it's cleaner to always ask the transport to sleep and let the transport implementor decide how to do it.

sleep(duration: float) -> None

Parameters

Name Description
duration
Required

The number of seconds to sleep.