Core HTTP shared client library for Python
corehttp provides shared exceptions and modules for Python SDK client libraries.
Getting started
Typically, you will not need to install corehttp, as it will be installed when you install one of the client libraries using it.
Transports
To use corehttp, you will need to choose a transport implementation. corehttp provides the following transports:
Synchronous transports:
RequestsTransport- A synchronous transport based on the Requests library.HttpXTransport- An synchronous transport based on the HTTPX library.
Asynchronous transports:
AioHttpTransport- An asynchronous transport based on the aiohttp library.AsyncHttpXTransport- An asynchronous transport based on the HTTPX library.
Each transport has its own dependencies, which you can install using the corehttp extras:
# Install individually.
pip install corehttp[requests]
pip install corehttp[aiohttp]
pip install corehttp[httpx]
# Install multiple.
pip install corehttp[requests,httpx]
If no transports are specified, corehttp will default to using RequestsTransport for synchronous pipeline requests and AioHttpTransport for asynchronous pipeline requests.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Indices and tables
Developer Documentation
- corehttp package
MatchConditions- Subpackages
- corehttp.rest package
AsyncHttpResponseAsyncHttpResponse.close()AsyncHttpResponse.iter_bytes()AsyncHttpResponse.iter_raw()AsyncHttpResponse.json()AsyncHttpResponse.raise_for_status()AsyncHttpResponse.read()AsyncHttpResponse.text()AsyncHttpResponse.contentAsyncHttpResponse.content_typeAsyncHttpResponse.encodingAsyncHttpResponse.headersAsyncHttpResponse.is_closedAsyncHttpResponse.is_stream_consumedAsyncHttpResponse.reasonAsyncHttpResponse.requestAsyncHttpResponse.status_codeAsyncHttpResponse.url
HttpRequestHttpResponseHttpResponse.close()HttpResponse.iter_bytes()HttpResponse.iter_raw()HttpResponse.json()HttpResponse.raise_for_status()HttpResponse.read()HttpResponse.text()HttpResponse.contentHttpResponse.content_typeHttpResponse.encodingHttpResponse.headersHttpResponse.is_closedHttpResponse.is_stream_consumedHttpResponse.reasonHttpResponse.requestHttpResponse.status_codeHttpResponse.url
- corehttp.runtime package
- corehttp.transport package
- corehttp.utils package
CaseInsensitiveDictCaseInsensitiveDict.clear()CaseInsensitiveDict.copy()CaseInsensitiveDict.get()CaseInsensitiveDict.items()CaseInsensitiveDict.keys()CaseInsensitiveDict.lowerkey_items()CaseInsensitiveDict.pop()CaseInsensitiveDict.popitem()CaseInsensitiveDict.setdefault()CaseInsensitiveDict.update()CaseInsensitiveDict.values()
CaseInsensitiveEnumMetacase_insensitive_dict()
- corehttp.rest package
- Submodules
- corehttp.credentials module
AccessTokenInfoAsyncTokenCredentialServiceKeyCredentialServiceNamedKeyCredentialTokenCredentialTokenRequestOptionsTokenRequestOptions.clear()TokenRequestOptions.copy()TokenRequestOptions.fromkeys()TokenRequestOptions.get()TokenRequestOptions.items()TokenRequestOptions.keys()TokenRequestOptions.pop()TokenRequestOptions.popitem()TokenRequestOptions.setdefault()TokenRequestOptions.update()TokenRequestOptions.values()TokenRequestOptions.claimsTokenRequestOptions.tenant_id
- corehttp.exceptions module
BaseErrorClientAuthenticationErrorClientAuthenticationError.add_note()ClientAuthenticationError.with_traceback()ClientAuthenticationError.argsClientAuthenticationError.continuation_tokenClientAuthenticationError.exc_msgClientAuthenticationError.exc_tracebackClientAuthenticationError.exc_typeClientAuthenticationError.exc_valueClientAuthenticationError.inner_exceptionClientAuthenticationError.message
DecodeErrorDeserializationErrorHttpResponseErrorResourceExistsErrorResourceExistsError.add_note()ResourceExistsError.with_traceback()ResourceExistsError.argsResourceExistsError.continuation_tokenResourceExistsError.exc_msgResourceExistsError.exc_tracebackResourceExistsError.exc_typeResourceExistsError.exc_valueResourceExistsError.inner_exceptionResourceExistsError.messageResourceExistsError.modelResourceExistsError.reasonResourceExistsError.responseResourceExistsError.status_code
ResourceModifiedErrorResourceModifiedError.add_note()ResourceModifiedError.with_traceback()ResourceModifiedError.argsResourceModifiedError.continuation_tokenResourceModifiedError.exc_msgResourceModifiedError.exc_tracebackResourceModifiedError.exc_typeResourceModifiedError.exc_valueResourceModifiedError.inner_exceptionResourceModifiedError.messageResourceModifiedError.modelResourceModifiedError.reasonResourceModifiedError.responseResourceModifiedError.status_code
ResourceNotFoundErrorResourceNotFoundError.add_note()ResourceNotFoundError.with_traceback()ResourceNotFoundError.argsResourceNotFoundError.continuation_tokenResourceNotFoundError.exc_msgResourceNotFoundError.exc_tracebackResourceNotFoundError.exc_typeResourceNotFoundError.exc_valueResourceNotFoundError.inner_exceptionResourceNotFoundError.messageResourceNotFoundError.modelResourceNotFoundError.reasonResourceNotFoundError.responseResourceNotFoundError.status_code
ResourceNotModifiedErrorResourceNotModifiedError.add_note()ResourceNotModifiedError.with_traceback()ResourceNotModifiedError.argsResourceNotModifiedError.continuation_tokenResourceNotModifiedError.exc_msgResourceNotModifiedError.exc_tracebackResourceNotModifiedError.exc_typeResourceNotModifiedError.exc_valueResourceNotModifiedError.inner_exceptionResourceNotModifiedError.messageResourceNotModifiedError.modelResourceNotModifiedError.reasonResourceNotModifiedError.responseResourceNotModifiedError.status_code
ResponseNotReadErrorResponseNotReadError.add_note()ResponseNotReadError.with_traceback()ResponseNotReadError.argsResponseNotReadError.continuation_tokenResponseNotReadError.exc_msgResponseNotReadError.exc_tracebackResponseNotReadError.exc_typeResponseNotReadError.exc_valueResponseNotReadError.inner_exceptionResponseNotReadError.message
SerializationErrorServiceRequestErrorServiceRequestError.add_note()ServiceRequestError.with_traceback()ServiceRequestError.argsServiceRequestError.continuation_tokenServiceRequestError.exc_msgServiceRequestError.exc_tracebackServiceRequestError.exc_typeServiceRequestError.exc_valueServiceRequestError.inner_exceptionServiceRequestError.message
ServiceResponseErrorServiceResponseError.add_note()ServiceResponseError.with_traceback()ServiceResponseError.argsServiceResponseError.continuation_tokenServiceResponseError.exc_msgServiceResponseError.exc_tracebackServiceResponseError.exc_typeServiceResponseError.exc_valueServiceResponseError.inner_exceptionServiceResponseError.message
StreamClosedErrorStreamConsumedErrorStreamConsumedError.add_note()StreamConsumedError.with_traceback()StreamConsumedError.argsStreamConsumedError.continuation_tokenStreamConsumedError.exc_msgStreamConsumedError.exc_tracebackStreamConsumedError.exc_typeStreamConsumedError.exc_valueStreamConsumedError.inner_exceptionStreamConsumedError.message
- corehttp.paging module
- corehttp.serialization module