public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static org.json.JSONObject |
getJSONFromEntity(org.apache.http.HttpEntity entity)
Read the response received from the API and converts it into a JSONObject object.
|
static org.apache.http.client.methods.HttpGet |
getRequest(String url,
HashMap<String,String> parameters,
String authorization)
Creates an instance of HttpGet containing the endpoint, the parameters and user authorization.
|
public static org.apache.http.client.methods.HttpGet getRequest(String url, HashMap<String,String> parameters, String authorization) throws URISyntaxException
url - The endpoint to send the GET request to.parameters - The parameters included in the GET request.authorization - The authorization token of the user.URISyntaxException - This will most likely be thrown when the baseURL is invalid.public static org.json.JSONObject getJSONFromEntity(org.apache.http.HttpEntity entity)
throws IOException
entity - The response received from the API.IOException - The connection could not be established.Copyright © 2021. All rights reserved.