Package edu.tufts.hrilab.util
Class Http
java.lang.Object
edu.tufts.hrilab.util.Http
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
log
protected static org.slf4j.Logger log
-
-
Constructor Details
-
Http
public Http()
-
-
Method Details
-
sendGetRequest
Returns the JSON string response from an endpoint via GET.- Parameters:
endpointUrl
- URL, including path, to make request toheaders
- Headers for request in a map- Returns:
- Response from the endpoint as JSON string
-
sendPostRequest
public static String sendPostRequest(String endpointUrl, Object requestBody, Map<String, String> headers) Returns the JSON string response from an endpoint via POST.- Parameters:
endpointUrl
- URL, including path, to make request torequestBody
- Body payload of requestheaders
- Headers for request in a map- Returns:
- Response from the endpoint as JSON string
-