Pipeline Class
A pipeline implementation.
This is implemented as a context manager, that will activate the context of the HTTP sender. The transport is the last node in the pipeline.
- Inheritance
-
PipelinePipeline
Constructor
Pipeline(transport: HttpTransportType, policies: Optional[List[Union[azure.core.pipeline.policies._base.HTTPPolicy, azure.core.pipeline.policies._base.SansIOHTTPPolicy]]] = None)
Parameters
- transport
Required
The Http Transport instance
Examples
Builds the pipeline for synchronous transport.
from azure.core.pipeline import Pipeline
from azure.core.pipeline.policies import RedirectPolicy, UserAgentPolicy
from azure.core.pipeline.transport import RequestsTransport, HttpRequest
# example: create request and policies
request = HttpRequest("GET", "https://bing.com")
policies = [
UserAgentPolicy("myuseragent"),
RedirectPolicy()
]
# run the pipeline
with Pipeline(transport=RequestsTransport(), policies=policies) as pipeline:
response = pipeline.run(request)
Methods
| run |
Runs the HTTP Request through the chained policies. |
run
Runs the HTTP Request through the chained policies.
run(request: HTTPRequestType, **kwargs: Any) -> azure.core.pipeline.PipelineResponse
Parameters
Returns
The PipelineResponse object
Return type
Feedback
Submit and view feedback for