Class URLEncodedContent

  • All Implemented Interfaces:
    IRequestContent

    public class URLEncodedContent
    extends java.lang.Object
    implements IRequestContent
    Content being encoded for "application/x-www-form-urlencoded", used by GET and POST methods.
    Author:
    Christopher Mindus
    • Field Detail

      • X_WWW_FORM_URLENCODED

        public static final java.lang.String X_WWW_FORM_URLENCODED
        The String: "application/x-www-form-urlencoded" for "Content-Type".
        See Also:
        Constant Field Values
    • Constructor Detail

      • URLEncodedContent

        public URLEncodedContent​(URLEncodedInput inputProp)
        Constructor.
        Parameters:
        inputProp - The URL encoded input.
    • Method Detail

      • onPreProcessRequest

        public void onPreProcessRequest​(RESTfulRequest request,
                                        boolean doPerform)
                                 throws PropException,
                                        java.io.UnsupportedEncodingException,
                                        java.net.URISyntaxException,
                                        java.io.UnsupportedEncodingException
        Pre-processes the request as required, i.e. to change the URL to add a Query String for e.g. a GET method.

        This call is done prior to establishing the URLConnection.

        Specified by:
        onPreProcessRequest in interface IRequestContent
        Parameters:
        request - The request.
        doPerform - Flag to perform the transaction or false to test validity.
        Throws:
        PropException - For property errors.
        java.io.UnsupportedEncodingException - For encoding errors.
        java.net.URISyntaxException - For URI syntax errors for parameters.
        java.io.UnsupportedEncodingException - For unsupported encodings.
      • onPostProcessRequest

        public void onPostProcessRequest​(RESTfulRequest request,
                                         boolean doPerform)
                                  throws PropException,
                                         java.io.IOException,
                                         java.io.UnsupportedEncodingException
        Pre-processes the request as required, typically to modify the URLConnection.
        Specified by:
        onPostProcessRequest in interface IRequestContent
        Parameters:
        request - The request.
        doPerform - Flag to perform the transaction or false to test validity.
        Throws:
        PropException - For property errors.
        java.io.IOException - For I/O errors.
        java.io.UnsupportedEncodingException - For unsupported encodings.