java.lang.Object
ai.docling.serve.client.operations.HttpOperations
- Direct Known Subclasses:
DoclingServeClient
Abstract base class for HTTP operations. Provides methods for executing HTTP requests such as GET and POST
and deserializing responses into specified types. This class is intended to be extended by subclasses that
implement these operations for specific use cases.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe header name used to specify the API key in HTTP requests. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract <I,O> O executeGet(RequestContext<I, O> requestContext) Executes an HTTP GET request using the details specified in the providedRequestContext.protected abstract <I,O> O executePost(RequestContext<I, O> requestContext) Executes an HTTP POST request using the details provided in theRequestContext.
-
Field Details
-
API_KEY_HEADER_NAME
The header name used to specify the API key in HTTP requests. This constant is commonly utilized in authentication mechanisms to include the API key in request headers.- See Also:
-
-
Constructor Details
-
HttpOperations
public HttpOperations()
-
-
Method Details
-
executeGet
Executes an HTTP GET request using the details specified in the providedRequestContext.- Type Parameters:
I- the type of the request payloadO- the type of the response object- Parameters:
requestContext- the context containing details such as the URI, request payload, and expected response type of the GET operation- Returns:
- an instance of the response type
O, which represents the deserialized response data
-
executePost
Executes an HTTP POST request using the details provided in theRequestContext. This method is designed to be implemented by subclasses and facilitates sending POST requests with a specified request payload and receiving a deserialized response.- Type Parameters:
I- the type of the request payloadO- the type of the response object- Parameters:
requestContext- the context containing details such as the URI, request payload, and expected response type of the POST operation- Returns:
- an instance of the response type
O, which represents the deserialized response data
-