Package arc.util

Class Http.HttpRequest

java.lang.Object
arc.util.Http.HttpRequest
Enclosing class:
Http

public static class Http.HttpRequest extends Object
  • Field Details

    • method

      public Http.HttpMethod method
    • url

      public String url
      The URL to send this request to.
    • headers

      public ObjectMap<String,String> headers
    • timeout

      public int timeout
      The time to wait for the HTTP request to be processed, use 0 to block until it is done. The timeout is used for both the timeout when establishing TCP connection, and the timeout until the first byte of data is received.
    • content

      public String content
      The content to be used in the HTTP request: A string encoded in the corresponding Content-Encoding set in the headers, with the data to send with the HTTP request. For example, in case of HTTP GET, the content is used as the query string of the GET while on a HTTP POST it is used to send the POST data.
    • contentStream

      public InputStream contentStream
      The content as a stream to be used for a POST for example, to transmit custom data.
    • contentLength

      public long contentLength
      Length of the content stream.
    • followRedirects

      public boolean followRedirects
      Sets whether 301 and 302 redirects are followed. By default true. Can't be changed in the web backend because this uses XmlHttpRequests which always redirect.
    • includeCredentials

      public boolean includeCredentials
      Whether a cross-origin request will include credentials. Default: false
    • errorHandler

      public Cons<Throwable> errorHandler
      Handler for 4xx + 5xx errors, as well as exceptions thrown during connection.
  • Constructor Details

    • HttpRequest

      protected HttpRequest()
    • HttpRequest

      protected HttpRequest(Http.HttpMethod method)
  • Method Details