Package com.hellosign.sdk.http
Class HttpPostRequest
- java.lang.Object
-
- com.hellosign.sdk.http.AbstractHttpRequest
-
- com.hellosign.sdk.http.HttpPostRequest
-
- Direct Known Subclasses:
HttpPutRequest
public class HttpPostRequest extends AbstractHttpRequest
This utility class provides an abstraction layer for sending multipart HTTP POST requests to a web server.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringmethod-
Fields inherited from class com.hellosign.sdk.http.AbstractHttpRequest
auth, DEFAULT_ENCODING, lastHttpStatusCode, lastResponseStream, url, USER_AGENT
-
-
Constructor Summary
Constructors Constructor Description HttpPostRequest(java.lang.String url)ConstructorHttpPostRequest(java.lang.String url, Authentication auth)ConstructorHttpPostRequest(java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> fields)ConstructorHttpPostRequest(java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> fields, Authentication auth)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.net.HttpURLConnectiongetConnection()Helper method to make an HTTP POST request.-
Methods inherited from class com.hellosign.sdk.http.AbstractHttpRequest
execute, getProxiedConnection, getResponseAsFile, getResponseBody, getResponseCode
-
-
-
-
Constructor Detail
-
HttpPostRequest
public HttpPostRequest(java.lang.String url) throws HelloSignExceptionConstructor- Parameters:
url- String- Throws:
HelloSignException- thrown if there is a problem making the HTTP request or processing the response
-
HttpPostRequest
public HttpPostRequest(java.lang.String url, Authentication auth) throws HelloSignExceptionConstructor- Parameters:
url- Stringauth- Authentication- Throws:
HelloSignException- thrown if there is a problem making the HTTP request or processing the response
-
HttpPostRequest
public HttpPostRequest(java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> fields) throws HelloSignExceptionConstructor- Parameters:
url- Stringfields- Map- Throws:
HelloSignException- thrown if there is a problem making the HTTP request or processing the response
-
HttpPostRequest
public HttpPostRequest(java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> fields, Authentication auth) throws HelloSignExceptionConstructor- Parameters:
url- Stringfields- Mapauth- Authentication- Throws:
HelloSignException- thrown if there is a problem making the HTTP request or processing the response
-
-
Method Detail
-
getConnection
protected java.net.HttpURLConnection getConnection() throws HelloSignExceptionHelper method to make an HTTP POST request. Intelligently detects whether Files have been attached and sends as an multipart form request.- Specified by:
getConnectionin classAbstractHttpRequest- Returns:
- HttpUrlConnection
- Throws:
HelloSignException- thrown if there is a problem making the HTTP request or processing the result
-
-