Interface HttpRequestBuilder

  • All Known Implementing Classes:
    HttpClient

    public interface HttpRequestBuilder
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default HttpContentRequest contentRequest​(java.lang.String method, java.lang.String url)
      Create a new request with the given method and url.
      This request will send content to the server if specified.
      default HttpContentRequest contentRequest​(java.lang.String method, java.net.URL url)
      Create a new request with the given method and url.
      This request will send content to the server if specified.
      default DeleteRequest delete​(java.lang.String url)
      Create a new DELETE request with the given url.
      default DeleteRequest delete​(java.net.URL url)
      Create a new DELETE request with the given url.
      default GetRequest get​(java.lang.String url)
      Create a new GET request with the given url.
      default GetRequest get​(java.net.URL url)
      Create a new GET request with the given url.
      default HeadRequest head​(java.lang.String url)
      Create a new HEAD request with the given url.
      default HeadRequest head​(java.net.URL url)
      Create a new HEAD request with the given url.
      default PostRequest post​(java.lang.String url)
      Create a new POST request with the given url.
      default PostRequest post​(java.net.URL url)
      Create a new POST request with the given url.
      default PutRequest put​(java.lang.String url)
      Create a new PUT request with the given url.
      default PutRequest put​(java.net.URL url)
      Create a new PUT request with the given url.
      default HttpRequest request​(java.lang.String method, java.lang.String url)
      Create a new request with the given method and url.
      default HttpRequest request​(java.lang.String method, java.net.URL url)
      Create a new request with the given method and url.
    • Method Detail

      • get

        default GetRequest get​(java.lang.String url)
                        throws java.net.MalformedURLException
        Create a new GET request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
        Throws:
        java.net.MalformedURLException - If the url is invalid
      • get

        default GetRequest get​(java.net.URL url)
        Create a new GET request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
      • head

        default HeadRequest head​(java.lang.String url)
                          throws java.net.MalformedURLException
        Create a new HEAD request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
        Throws:
        java.net.MalformedURLException - If the url is invalid
      • head

        default HeadRequest head​(java.net.URL url)
        Create a new HEAD request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
      • delete

        default DeleteRequest delete​(java.lang.String url)
                              throws java.net.MalformedURLException
        Create a new DELETE request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
        Throws:
        java.net.MalformedURLException - If the url is invalid
      • delete

        default DeleteRequest delete​(java.net.URL url)
        Create a new DELETE request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
      • post

        default PostRequest post​(java.lang.String url)
                          throws java.net.MalformedURLException
        Create a new POST request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
        Throws:
        java.net.MalformedURLException - If the url is invalid
      • post

        default PostRequest post​(java.net.URL url)
        Create a new POST request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
      • put

        default PutRequest put​(java.lang.String url)
                        throws java.net.MalformedURLException
        Create a new PUT request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
        Throws:
        java.net.MalformedURLException - If the url is invalid
      • put

        default PutRequest put​(java.net.URL url)
        Create a new PUT request with the given url.
        Parameters:
        url - The url to send the request to
        Returns:
        The created request
      • request

        default HttpRequest request​(java.lang.String method,
                                    java.lang.String url)
                             throws java.net.MalformedURLException
        Create a new request with the given method and url.
        Parameters:
        method - The method to use
        url - The url to send the request to
        Returns:
        The created request
        Throws:
        java.net.MalformedURLException - If the url is invalid
      • request

        default HttpRequest request​(java.lang.String method,
                                    java.net.URL url)
        Create a new request with the given method and url.
        Parameters:
        method - The method to use
        url - The url to send the request to
        Returns:
        The created request
      • contentRequest

        default HttpContentRequest contentRequest​(java.lang.String method,
                                                  java.lang.String url)
                                           throws java.net.MalformedURLException
        Create a new request with the given method and url.
        This request will send content to the server if specified.
        Parameters:
        method - The method to use
        url - The url to send the request to
        Returns:
        The created request
        Throws:
        java.net.MalformedURLException - If the url is invalid
      • contentRequest

        default HttpContentRequest contentRequest​(java.lang.String method,
                                                  java.net.URL url)
        Create a new request with the given method and url.
        This request will send content to the server if specified.
        Parameters:
        method - The method to use
        url - The url to send the request to
        Returns:
        The created request