Class 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 Detail

      • method

        protected java.lang.String method
    • Constructor Detail

      • HttpPostRequest

        public HttpPostRequest​(java.lang.String url)
                        throws HelloSignException
        Constructor
        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 HelloSignException
        Constructor
        Parameters:
        url - String
        auth - 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 HelloSignException
        Constructor
        Parameters:
        url - String
        fields - 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 HelloSignException
        Constructor
        Parameters:
        url - String
        fields - Map
        auth - 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 HelloSignException
        Helper method to make an HTTP POST request. Intelligently detects whether Files have been attached and sends as an multipart form request.
        Specified by:
        getConnection in class AbstractHttpRequest
        Returns:
        HttpUrlConnection
        Throws:
        HelloSignException - thrown if there is a problem making the HTTP request or processing the result