Class ClassicHttpRequests

java.lang.Object
org.apache.hc.client5.http.classic.methods.ClassicHttpRequests

@Deprecated public final class ClassicHttpRequests extends Object
Deprecated.
Use ClassicRequestBuilder
Common HTTP methods using HttpUriRequest as a HTTP request message representation.

Each static method creates a request object of the exact subclass of HttpUriRequest with a non-null URI.

Since:
5.0
  • Constructor Details

    • ClassicHttpRequests

      public ClassicHttpRequests()
      Deprecated.
  • Method Details

    • create

      public static HttpUriRequest create(org.apache.hc.core5.http.Method method, String uri)
      Deprecated.
      Creates a new HttpUriRequest for the given Method and String URI.
      Parameters:
      method - A method.
      uri - a URI.
      Returns:
      a new HttpUriRequest.
    • create

      public static HttpUriRequest create(org.apache.hc.core5.http.Method method, URI uri)
      Deprecated.
      Creates a new HttpUriRequest for the given Method and URI.
      Parameters:
      method - A method.
      uri - a URI.
      Returns:
      a new HttpUriRequest.
    • create

      public static HttpUriRequest create(String method, String uri)
      Deprecated.
      Creates a new HttpUriRequest for the given method and String URI.
      Parameters:
      method - A method supported by this class.
      uri - a non-null request string URI.
      Returns:
      A new HttpUriRequest.
      Throws:
      IllegalArgumentException - if the method is not supported.
      IllegalArgumentException - if the string URI is null.
    • create

      public static HttpUriRequest create(String method, URI uri)
      Deprecated.
      Creates a new HttpUriRequest for the given method and URI.
      Parameters:
      method - A method supported by this class.
      uri - a non-null request URI.
      Returns:
      A new HttpUriRequest.
      Throws:
      IllegalArgumentException - if the method is not supported.
      IllegalArgumentException - if the URI is null.
    • delete

      public static HttpUriRequest delete(String uri)
      Deprecated.
      Constructs a new "DELETE" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "DELETE" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • delete

      public static HttpUriRequest delete(URI uri)
      Deprecated.
      Constructs a new "DELETE" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "DELETE" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • get

      public static HttpUriRequest get(String uri)
      Deprecated.
      Constructs a new "GET" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "GET" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • get

      public static HttpUriRequest get(URI uri)
      Deprecated.
      Constructs a new "GET" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "GET" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • head

      public static HttpUriRequest head(String uri)
      Deprecated.
      Constructs a new "HEAD" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "HEAD" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • head

      public static HttpUriRequest head(URI uri)
      Deprecated.
      Constructs a new "HEAD" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "HEAD" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • options

      public static HttpUriRequest options(String uri)
      Deprecated.
      Constructs a new "OPTIONS" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "OPTIONS" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • options

      public static HttpUriRequest options(URI uri)
      Deprecated.
      Constructs a new "OPTIONS" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "OPTIONS" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • patch

      public static HttpUriRequest patch(String uri)
      Deprecated.
      Constructs a new "PATCH" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "PATCH" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • patch

      public static HttpUriRequest patch(URI uri)
      Deprecated.
      Constructs a new "PATCH" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "PATCH" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • post

      public static HttpUriRequest post(String uri)
      Deprecated.
      Constructs a new "POST" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "POST" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • post

      public static HttpUriRequest post(URI uri)
      Deprecated.
      Constructs a new "POST" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "POST" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • put

      public static HttpUriRequest put(String uri)
      Deprecated.
      Constructs a new "PUT" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "PUT" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • put

      public static HttpUriRequest put(URI uri)
      Deprecated.
      Constructs a new "PUT" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "PUT" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • trace

      public static HttpUriRequest trace(String uri)
      Deprecated.
      Constructs a new "TRACE" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "TRACE" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.
    • trace

      public static HttpUriRequest trace(URI uri)
      Deprecated.
      Constructs a new "TRACE" HttpUriRequest initialized with the given URI.
      Parameters:
      uri - a non-null request URI.
      Returns:
      a new "TRACE" HttpUriRequest.
      Throws:
      IllegalArgumentException - if the URI is null.