Class Post


  • public class Post
    extends Request<Post>
    Executes a POST request.
    Author:
    Igor Polevoy
    • Constructor Detail

      • Post

        public Post​(String url,
                    byte[] content,
                    int connectTimeout,
                    int readTimeout)
        Constructor for making POST requests.
        Parameters:
        url - URL of resource.
        content - content to be posted to the resource.
        connectTimeout - connection timeout.
        readTimeout - read timeout.
    • Method Detail

      • doConnect

        public Post doConnect()
        Description copied from class: Request
        Makes a connection to the remote resource.
        Specified by:
        doConnect in class Request<Post>
        Returns:
        self.
      • params

        public Post params​(String... namesAndValues)
        Convenience method to add multiple parameters to the request.

        Names and values alternate: name1, value1, name2, value2, etc.
        Parameters:
        namesAndValues - names/values of multiple fields to be added to the request.
        Returns:
        self
      • param

        public Post param​(String name,
                          String value)
        Adds a parameter to the request as in a HTML form.
        Parameters:
        name - name of parameter
        value - value of parameter
        Returns:
        self
      • main

        public static void main​(String[] args)