public class HttpUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpUtils.HttpRequest |
static class |
HttpUtils.HttpResponse |
static interface |
HttpUtils.Methods |
| Constructor and Description |
|---|
HttpUtils() |
| Modifier and Type | Method and Description |
|---|---|
static MapBuilder<String,String> |
createDefaultAwsHeaders() |
private static HttpURLConnection |
createHttpConnection(URL endpointUrl,
String httpMethod,
Map<String,String> headers) |
static URL |
createUrl(String url) |
static HttpUtils.HttpResponse |
invokeHttpRequest(HttpUtils.HttpRequest httpRequest)
Makes a http request to the specified endpoint
|
static byte[] |
readBytes(InputStream input) |
private static byte[] |
readResponse(HttpURLConnection response) |
private static void |
sendBody(HttpURLConnection connection,
byte[] body) |
static String |
urlEncode(String url) |
static String |
urlEncode(String url,
boolean keepPathSlash) |
public static HttpUtils.HttpResponse invokeHttpRequest(HttpUtils.HttpRequest httpRequest)
httpRequest - private static HttpURLConnection createHttpConnection(URL endpointUrl, String httpMethod, Map<String,String> headers)
private static void sendBody(HttpURLConnection connection, byte[] body) throws IOException
IOExceptionprivate static byte[] readResponse(HttpURLConnection response) throws IOException
IOExceptionpublic static byte[] readBytes(InputStream input) throws IOException
IOExceptionpublic static MapBuilder<String,String> createDefaultAwsHeaders()
Copyright © 2018. All rights reserved.