Class Route.FetchOptions

  • Enclosing interface:
    Route

    public static class Route.FetchOptions
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Map<java.lang.String,​java.lang.String> headers
      If set changes the request HTTP headers.
      java.lang.Integer maxRedirects
      Maximum number of request redirects that will be followed automatically.
      java.lang.String method
      If set changes the request method (e.g.
      java.lang.Object postData
      If set changes the post data of request.
      java.lang.Double timeout
      Request timeout in milliseconds.
      java.lang.String url
      If set changes the request URL.
    • Constructor Summary

      Constructors 
      Constructor Description
      FetchOptions()  
    • Field Detail

      • headers

        public java.util.Map<java.lang.String,​java.lang.String> headers
        If set changes the request HTTP headers. Header values will be converted to a string.
      • maxRedirects

        public java.lang.Integer maxRedirects
        Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded. Defaults to 20. Pass 0 to not follow redirects.
      • method

        public java.lang.String method
        If set changes the request method (e.g. GET or POST).
      • postData

        public java.lang.Object postData
        If set changes the post data of request.
      • timeout

        public java.lang.Double timeout
        Request timeout in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
      • url

        public java.lang.String url
        If set changes the request URL. New URL must have same protocol as original one.
    • Constructor Detail

      • FetchOptions

        public FetchOptions()
    • Method Detail

      • setHeaders

        public Route.FetchOptions setHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
        If set changes the request HTTP headers. Header values will be converted to a string.
      • setMaxRedirects

        public Route.FetchOptions setMaxRedirects​(int maxRedirects)
        Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded. Defaults to 20. Pass 0 to not follow redirects.
      • setMethod

        public Route.FetchOptions setMethod​(java.lang.String method)
        If set changes the request method (e.g. GET or POST).
      • setPostData

        public Route.FetchOptions setPostData​(java.lang.String postData)
        If set changes the post data of request.
      • setPostData

        public Route.FetchOptions setPostData​(byte[] postData)
        If set changes the post data of request.
      • setTimeout

        public Route.FetchOptions setTimeout​(double timeout)
        Request timeout in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
      • setUrl

        public Route.FetchOptions setUrl​(java.lang.String url)
        If set changes the request URL. New URL must have same protocol as original one.