Package org.elasticsearch.test.rest.yaml
Class ClientYamlTestResponse
java.lang.Object
org.elasticsearch.test.rest.yaml.ClientYamlTestResponse
Response obtained from a REST call, eagerly reads the response body into a string for later optional parsing.
Supports parsing the response body when needed and returning specific values extracted from it.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionParses the response body and extracts a specific value from it (identified by the provided path)Parses the response body and extracts a specific value from it (identified by the provided path)getBody()
Returns the body properly parsed depending on the content type.Returns the body as a stringgetHeaders
(String name) Get a list of all the values of a given header returned in the response.int
Get a list of all of the values of all warning headers returned in the response.boolean
isError()
-
Constructor Details
-
ClientYamlTestResponse
- Throws:
IOException
-
-
Method Details
-
getStatusCode
public int getStatusCode() -
getReasonPhrase
-
getWarningHeaders
Get a list of all of the values of all warning headers returned in the response. -
getHeaders
Get a list of all the values of a given header returned in the response. -
getBody
Returns the body properly parsed depending on the content type. Might be a string or a json object parsed as a map.- Throws:
IOException
-
getBodyAsString
Returns the body as a string -
isError
public boolean isError() -
evaluate
Parses the response body and extracts a specific value from it (identified by the provided path)- Throws:
IOException
-
evaluate
Parses the response body and extracts a specific value from it (identified by the provided path)- Throws:
IOException
-