public class HttpClientService extends Object
Constructor and Description |
---|
HttpClientService(String proxyHost,
Integer proxyPort,
String proxyUsername,
String proxyPassword,
Integer connectionTimeout,
Integer readTimeout)
Constructor for instance using proxy.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
send(org.apache.http.client.methods.HttpUriRequest method,
String uri,
String body,
Map<String,String> headers,
Map<String,String> cookies) |
InputStream |
sendGet(String uri,
Map<String,String> headers,
Map<String,String> cookies)
Makes a http GET call to given uri with given data.
|
InputStream |
sendPost(String uri,
org.apache.http.NameValuePair[] nameValuePairs,
Map<String,String> headers,
Map<String,String> cookies)
Makes a http POST call to given uri with given data.
|
public HttpClientService(String proxyHost, Integer proxyPort, String proxyUsername, String proxyPassword, Integer connectionTimeout, Integer readTimeout)
proxyHost
- - proxy hostproxyPort
- - proxy portproxyUsername
- - proxy usernameproxyPassword
- - proxy passwordconnectionTimeout
- = connection timeoutreadTimeout
- - read timeoutpublic InputStream sendPost(String uri, org.apache.http.NameValuePair[] nameValuePairs, Map<String,String> headers, Map<String,String> cookies) throws IOException
uri
- - uri to make call tonameValuePairs
- - body of the message to be sendheaders
- - headers to send with bodycookies
- - bookies to send with bodyIOException
- - if something goes wrongpublic InputStream send(org.apache.http.client.methods.HttpUriRequest method, String uri, String body, Map<String,String> headers, Map<String,String> cookies) throws IOException
IOException
@NotNull public InputStream sendGet(String uri, Map<String,String> headers, Map<String,String> cookies) throws IOException
uri
- - uri to make call toheaders
- - headers to send with bodycookies
- - bookies to send with bodyIOException
- - if something goes wrongCopyright © 2010–2020. All rights reserved.