public final class SimpleHttpClient
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SimpleHttpClient.SimpleHttpClientBuilder
Builder used to create a simple http client
|
Modifier and Type | Field and Description |
---|---|
static byte[] |
EMPTY_BYTE_ARRAY |
Modifier and Type | Method and Description |
---|---|
SimpleHttpResponse |
makeGetRequest(java.lang.String url,
java.util.Map<java.lang.String,?> additionalParameters)
Issues a get request
|
SimpleHttpResponse |
makePostRequest(java.lang.String url,
java.util.Map<java.lang.String,?> additionalParameters)
Issues a post request
|
SimpleHttpResponse |
makePostRequest(java.lang.String url,
java.lang.String requestBody)
Issues a post request
|
@Nullable public SimpleHttpResponse makeGetRequest(@NotNull java.lang.String url, @Nullable java.util.Map<java.lang.String,?> additionalParameters) throws java.io.IOException
url
- The url to send the request toadditionalParameters
- Any additional parameters to add to the urljava.net.MalformedURLException
- If the url provided is not formatted correctlyjava.io.IOException
- If there was an error reading the URL@Nullable public SimpleHttpResponse makePostRequest(@NotNull java.lang.String url, @Nullable java.util.Map<java.lang.String,?> additionalParameters) throws java.io.IOException
url
- The url to send the request toadditionalParameters
- Any parameters to include in the post bodyjava.net.MalformedURLException
- If the url provided is not formatted correctlyjava.io.IOException
- If there was an error reading the URL@Nullable public SimpleHttpResponse makePostRequest(@NotNull java.lang.String url, @Nullable java.lang.String requestBody) throws java.io.IOException
url
- The url to send the request torequestBody
- The body of the post requestjava.net.MalformedURLException
- If the url provided is not formatted correctlyjava.io.IOException
- If there was an error reading the URL