Package com.swrve.sdk.rest
Class RESTClient
- java.lang.Object
-
- com.swrve.sdk.rest.RESTClient
-
- All Implemented Interfaces:
IRESTClient
public class RESTClient extends java.lang.Object implements IRESTClient
Used internally to implement an object capable to perform REST requests.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.List<java.lang.String>
metrics
Safeguarded against multiple writers and on copy-and-clean when writing the headers.
-
Constructor Summary
Constructors Constructor Description RESTClient(int httpTimeout)
RESTClient(int httpTimeout, SwrveSSLSocketFactoryConfig socketFactories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
get(java.lang.String endpoint, IRESTResponseListener callback)
void
get(java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.String> params, IRESTResponseListener callback)
void
post(java.lang.String endpoint, java.lang.String encodedBody, IRESTResponseListener callback)
void
post(java.lang.String endpoint, java.lang.String encodedBody, IRESTResponseListener callback, java.lang.String contentType)
-
-
-
Constructor Detail
-
RESTClient
public RESTClient(int httpTimeout)
-
RESTClient
public RESTClient(int httpTimeout, SwrveSSLSocketFactoryConfig socketFactories)
-
-
Method Detail
-
get
public void get(java.lang.String endpoint, IRESTResponseListener callback)
- Specified by:
get
in interfaceIRESTClient
-
get
public void get(java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.String> params, IRESTResponseListener callback) throws java.io.UnsupportedEncodingException
- Specified by:
get
in interfaceIRESTClient
- Throws:
java.io.UnsupportedEncodingException
-
post
public void post(java.lang.String endpoint, java.lang.String encodedBody, IRESTResponseListener callback)
- Specified by:
post
in interfaceIRESTClient
-
post
public void post(java.lang.String endpoint, java.lang.String encodedBody, IRESTResponseListener callback, java.lang.String contentType)
- Specified by:
post
in interfaceIRESTClient
-
-