Package com.azure.core.http
Class HttpPipelineCallContext
java.lang.Object
com.azure.core.http.HttpPipelineCallContext
Represents the context for a single HTTP request in the HTTP pipeline.
This class encapsulates the HTTP request and the associated context data. The context data is a key-value store that can be used to pass additional information along with the HTTP request.
It provides methods to get and set the HTTP request, get the context data, and get and set data in the context using a key.
This class is useful when you want to send an HTTP request through the HTTP pipeline and need to associate additional data with the request.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGets the context associated to the HTTP call.Gets a value with the given key stored in the context.Gets the HTTP request.voidStores a key-value data in the context.setHttpRequest(HttpRequest request) Sets the HTTP request object in the context.
-
Method Details
-
setData
Stores a key-value data in the context.- Parameters:
key- The key to add.value- The value to associate with that key.
-
getData
Gets a value with the given key stored in the context.- Parameters:
key- The key to find in the context.- Returns:
- The value associated with the key.
-
getContext
Gets the context associated to the HTTP call.The returned context is a snapshot of the data stored in this http pipeline call context.
- Returns:
- The context associated to the HTTP call.
-
getHttpRequest
Gets the HTTP request.- Returns:
- The HTTP request.
-
setHttpRequest
Sets the HTTP request object in the context.- Parameters:
request- The HTTP request.- Returns:
- The updated HttpPipelineCallContext object.
-