Package dev.array21.httplib
Class Http
java.lang.Object
dev.array21.httplib.Http
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classclass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmakeRequest(Http.RequestMethod method, String targetUrl, HashMap<String,String> params, Http.MediaFormat requestBodyFormat, String requestBody, HashMap<String,String> customHeaders)Send a HTTP Request
-
Constructor Details
-
Http
public Http() -
Http
public Http(boolean debugMode)
-
-
Method Details
-
makeRequest
public Http.ResponseObject makeRequest(Http.RequestMethod method, String targetUrl, HashMap<String,String> params, Http.MediaFormat requestBodyFormat, String requestBody, HashMap<String,String> customHeaders) throws MalformedURLException, IOExceptionSend a HTTP Request- Parameters:
method- Method to use (e.g POST)targetUrl- URL to send the request to (e.g https://example.com)params- URL Parameters to be used- Returns:
- Returns a ResponseObject
- Throws:
MalformedURLException- Thrown when an invalid URL is givenIOException- Thrown when an IOException occurs
-