public class JsonHTTPClientWrapper extends Object
Constructor and Description |
---|
JsonHTTPClientWrapper(String url,
String user,
String password,
String proxy)
Initializes a new connection with the given connection information.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
closes the connection.
|
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient() |
com.google.gson.JsonElement |
getJson(String path)
Issues a get request.
|
com.google.gson.JsonElement |
getJson(String path,
Map<String,String> parameters)
Issues a get request, urlencoding the given parameters.
|
String |
getProxy() |
com.google.gson.JsonElement |
postJson(String path,
com.google.gson.JsonElement element)
Issues a post request, using the given data.
|
com.google.gson.JsonElement |
putJson(String path,
com.google.gson.JsonElement element)
Issues a put request, using the given data.
|
public String getProxy()
public void destroy()
public com.google.gson.JsonElement putJson(String path, com.google.gson.JsonElement element)
path
- the path (relative to the url) to issue the request onelement
- the put-datapublic com.google.gson.JsonElement postJson(String path, com.google.gson.JsonElement element)
path
- the path (relative to the url) to issue the request onelement
- the post-datapublic com.google.gson.JsonElement getJson(String path)
path
- the path (relative to the url) to issue the request onpublic com.google.gson.JsonElement getJson(String path, Map<String,String> parameters)
path
- the path (relative to the url) to issue the request onparameters
- a map where the keys are paramternames and the values are the values.public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
Copyright © 2004-2018. All Rights Reserved.