public IHalClient
Interface to a HAL Client
| Modifier and Type | Method and Description |
|---|---|
com.google.gson.JsonElement |
fetch(java.lang.String path,
boolean encodePath)
Fetches the HAL document from the provided path
|
com.google.gson.JsonElement |
fetch(java.lang.String path)
Fetches the HAL document from the provided path
|
void |
forAll(java.lang.String linkName,
java.util.function.Consumer<java.util.Map> closure)
Calls the closure with a Map of attributes for all links associated with the link name
|
java.lang.String |
linkUrl(java.lang.String name)
Returns the HREF of the named link from the current HAL document
|
IHalClient |
navigate(java.util.Map<java.lang.String,? extends java.lang.Object> options,
java.lang.String link)
Navigates the URL associated with the given link using the current HAL document
|
IHalClient |
navigate(java.lang.String link)
Navigates the URL associated with the given link using the current HAL document
|
au.com.dius.pact.com.github.michaelbull.result.Result<java.lang.Boolean,java.lang.Exception> |
postJson(java.lang.String url,
java.lang.String body)
Upload the JSON document to the provided URL, using a POST request
|
au.com.dius.pact.com.github.michaelbull.result.Result<java.lang.Boolean,java.lang.Exception> |
postJson(java.lang.String url,
java.lang.String body,
kotlin.jvm.functions.Function2<? super java.lang.Integer,? super org.apache.http.client.methods.CloseableHttpResponse,java.lang.Boolean> handler)
Upload the JSON document to the provided URL, using a POST request
|
java.lang.Object |
uploadJson(java.lang.String path,
java.lang.String bodyJson)
Upload the JSON document to the provided path, using a PUT request
|
java.lang.Object |
uploadJson(java.lang.String path,
java.lang.String bodyJson,
java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Object> closure)
Upload the JSON document to the provided path, using a PUT request
|
java.lang.Object |
uploadJson(java.lang.String path,
java.lang.String bodyJson,
java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Object> closure,
boolean encodePath)
Upload the JSON document to the provided path, using a PUT request
|
IHalClient navigate(java.util.Map<java.lang.String,? extends java.lang.Object> options, java.lang.String link)
Navigates the URL associated with the given link using the current HAL document
options - Map of key-value pairs to use for parsing templated linkslink - Link name to navigateIHalClient navigate(java.lang.String link)
Navigates the URL associated with the given link using the current HAL document
link - Link name to navigatejava.lang.String linkUrl(java.lang.String name)
Returns the HREF of the named link from the current HAL document
void forAll(java.lang.String linkName,
java.util.function.Consumer<java.util.Map> closure)
Calls the closure with a Map of attributes for all links associated with the link name
linkName - Name of the link to loop overclosure - Closure to invoke with the link attributesjava.lang.Object uploadJson(java.lang.String path,
java.lang.String bodyJson)
Upload the JSON document to the provided path, using a PUT request
path - Path to upload the documentbodyJson - JSON contents for the bodyjava.lang.Object uploadJson(java.lang.String path,
java.lang.String bodyJson,
java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Object> closure)
Upload the JSON document to the provided path, using a PUT request
path - Path to upload the documentbodyJson - JSON contents for the bodyclosure - Closure that will be invoked with details about the response. The result from the closure will be
returned.java.lang.Object uploadJson(java.lang.String path,
java.lang.String bodyJson,
java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Object> closure,
boolean encodePath)
Upload the JSON document to the provided path, using a PUT request
path - Path to upload the documentbodyJson - JSON contents for the bodyclosure - Closure that will be invoked with details about the response. The result from the closure will be
returned.encodePath - If the path must be encoded beforehand.au.com.dius.pact.com.github.michaelbull.result.Result<java.lang.Boolean,java.lang.Exception> postJson(java.lang.String url,
java.lang.String body)
Upload the JSON document to the provided URL, using a POST request
url - Url to upload the document tobody - JSON contents for the bodyau.com.dius.pact.com.github.michaelbull.result.Result<java.lang.Boolean,java.lang.Exception> postJson(java.lang.String url,
java.lang.String body,
kotlin.jvm.functions.Function2<? super java.lang.Integer,? super org.apache.http.client.methods.CloseableHttpResponse,java.lang.Boolean> handler)
Upload the JSON document to the provided URL, using a POST request
url - Url to upload the document tobody - JSON contents for the bodyhandler - Response handlercom.google.gson.JsonElement fetch(java.lang.String path,
boolean encodePath)
Fetches the HAL document from the provided path
path - The path to the HAL document. If it is a relative path, it is relative to the base URLencodePath - If the path should be encoded to make a valid URLcom.google.gson.JsonElement fetch(java.lang.String path)
Fetches the HAL document from the provided path
path - The path to the HAL document. If it is a relative path, it is relative to the base URL