Class AbstractRequester

  • Direct Known Subclasses:
    GETRequester, POSTRequester

    public abstract class AbstractRequester
    extends Object

    Class which contains the logic for sending URL requests to a specified address.

    Since:
    1.2.0
    • Constructor Detail

      • AbstractRequester

        protected AbstractRequester()

        Default constructor. Specifies the charset to be used for requests as UTF-8.

      • AbstractRequester

        protected AbstractRequester​(Charset charset)

        Overloaded constructor. Loads the request properties and other data needed for the requesters.

        Parameters:
        charset - the charset to use when doing a request
    • Method Detail

      • getResponse

        public abstract HttpResponse<String> getResponse​(String url)

        Retrieves the response from the specified URL.

        Parameters:
        url - the URL to call
        Returns:
        the response as an HttpResponse
      • getCharset

        public final Charset getCharset()

        Getter for charset.

        Returns:
        the charset
      • setCharset

        public final void setCharset​(Charset charset)

        Setter for charset.

        Parameters:
        charset - the charset