public class HttpApi
Modifier and Type | Class and Description |
---|---|
static class |
HttpApi.Companion |
Modifier and Type | Field and Description |
---|---|
static HttpApi.Companion |
Companion |
Constructor and Description |
---|
HttpApi(java.net.URL root,
NonExistentClass mapper) |
Modifier and Type | Method and Description |
---|---|
NonExistentClass |
getMapper() |
java.net.URL |
getRoot() |
void |
postJson(java.lang.String path,
java.lang.Object data)
Send a POST with a payload to the path on the API specified.
|
void |
postPlain(java.lang.String path,
java.lang.String data)
Send a POST with a payload to the path on the API specified.
|
void |
putJson(java.lang.String path,
java.lang.Object data)
Send a PUT with a payload to the path on the API specified.
|
public static HttpApi.Companion Companion
public void putJson(java.lang.String path, java.lang.Object data)
Send a PUT with a payload to the path on the API specified.
data
- String values are assumed to be valid JSON. All other values will be mapped to JSON.public void postJson(java.lang.String path, java.lang.Object data)
Send a POST with a payload to the path on the API specified.
data
- String values are assumed to be valid JSON. All other values will be mapped to JSON.public void postPlain(java.lang.String path, java.lang.String data)
Send a POST with a payload to the path on the API specified.
data
- String payloadpublic java.net.URL getRoot()
public NonExistentClass getMapper()