Class DUUIHttpRequestHandler
java.lang.Object
org.texttechnologylab.DockerUnifiedUIMAInterface.driver.DUUIHttpRequestHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordArecordclass of the response status code and body in a byte array. -
Constructor Summary
ConstructorsConstructorDescriptionDUUIHttpRequestHandler(HttpClient client, String componentUrl, long timeout) -
Method Summary
Modifier and TypeMethodDescriptionget()Send a GET query to the component.Send a GET query to the given endpoint on the component.Send a GET query with parameters to the given endpoint on the component.Get the DUUI V1 documentation of the component.voidAdds the given name-value pair to the set of headers for this requestvoidAdds the given name-value pairs to the set of headers for this request.Send a POST request with the given data to the given endpoint on the component.process(byte[] data) Send aDUUI V1 processrequest to the component.voidSet the given header to the given value.withHeaders(String... headers) Create a copy of this request handler with the given headers set.
-
Constructor Details
-
DUUIHttpRequestHandler
-
-
Method Details
-
getDocumentation
Get the DUUI V1 documentation of the component. Equivalent toget("/v1/documentation").- Returns:
- the
response
-
process
Send aDUUI V1 processrequest to the component.- Parameters:
data- an array of encoded data to send to the component- Returns:
- the
response
-
get
Send a GET query to the component.- Returns:
- the
response
-
get
Send a GET query to the given endpoint on the component.- Parameters:
path- the path of the endpoint- Returns:
- the
response
-
get
Send a GET query with parameters to the given endpoint on the component.- Parameters:
path- the path of the endpointparameters- a list of name-value pairs to be formatted as a GET query string- Returns:
- the
response
-
post
Send a POST request with the given data to the given endpoint on the component.- Parameters:
path- the path of the endpointdata- the data as a byte array- Returns:
- the
response
-
header
Adds the given name-value pair to the set of headers for this request- Parameters:
name- the header namevalue- the header value- See Also:
-
headers
Adds the given name-value pairs to the set of headers for this request.- Parameters:
headers- the list of name-value pairs- See Also:
-
setHeader
Set the given header to the given value. Overwrites previously set values.- Parameters:
name- the name of the header to setvalue- the value of the header- See Also:
-
withHeaders
Create a copy of this request handler with the given headers set.- Parameters:
headers- a list of name-value header pairs- Returns:
- the new request handler
- See Also:
-