Class RequestOptionsImpl

    • Field Detail

      • params

        java.util.Map<java.lang.String,​java.lang.Object> params
      • method

        java.lang.String method
      • headers

        java.util.Map<java.lang.String,​java.lang.String> headers
      • data

        java.lang.Object data
      • failOnStatusCode

        java.lang.Boolean failOnStatusCode
      • ignoreHTTPSErrors

        java.lang.Boolean ignoreHTTPSErrors
      • timeout

        java.lang.Double timeout
      • maxRedirects

        java.lang.Integer maxRedirects
    • Constructor Detail

      • RequestOptionsImpl

        public RequestOptionsImpl()
    • Method Detail

      • setHeader

        public RequestOptions setHeader​(java.lang.String name,
                                        java.lang.String value)
        Description copied from interface: RequestOptions
        Sets an HTTP header to the request. This header will apply to the fetched request as well as any redirects initiated by it.
        Specified by:
        setHeader in interface RequestOptions
        Parameters:
        name - Header name.
        value - Header value.
      • setData

        public RequestOptions setData​(java.lang.String data)
        Description copied from interface: RequestOptions
        Sets the request's post data.
        Specified by:
        setData in interface RequestOptions
        Parameters:
        data - Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and content-type header will be set to application/json if not explicitly set. Otherwise the content-type header will be set to application/octet-stream if not explicitly set.
      • setData

        public RequestOptions setData​(byte[] data)
        Description copied from interface: RequestOptions
        Sets the request's post data.
        Specified by:
        setData in interface RequestOptions
        Parameters:
        data - Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and content-type header will be set to application/json if not explicitly set. Otherwise the content-type header will be set to application/octet-stream if not explicitly set.
      • setData

        public RequestOptions setData​(java.lang.Object data)
        Description copied from interface: RequestOptions
        Sets the request's post data.
        Specified by:
        setData in interface RequestOptions
        Parameters:
        data - Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and content-type header will be set to application/json if not explicitly set. Otherwise the content-type header will be set to application/octet-stream if not explicitly set.
      • setForm

        public RequestOptions setForm​(FormData form)
        Description copied from interface: RequestOptions
        Provides FormData object that will be serialized as html form using application/x-www-form-urlencoded encoding and sent as this request body. If this parameter is specified content-type header will be set to application/x-www-form-urlencoded unless explicitly provided.
        Specified by:
        setForm in interface RequestOptions
        Parameters:
        form - Form data to be serialized as html form using application/x-www-form-urlencoded encoding and sent as this request body.
      • setMultipart

        public RequestOptions setMultipart​(FormData form)
        Description copied from interface: RequestOptions
        Provides FormData object that will be serialized as html form using multipart/form-data encoding and sent as this request body. If this parameter is specified content-type header will be set to multipart/form-data unless explicitly provided.
        Specified by:
        setMultipart in interface RequestOptions
        Parameters:
        form - Form data to be serialized as html form using multipart/form-data encoding and sent as this request body.
      • setQueryParam

        public RequestOptions setQueryParam​(java.lang.String name,
                                            java.lang.String value)
        Description copied from interface: RequestOptions
        Adds a query parameter to the request URL.
        Specified by:
        setQueryParam in interface RequestOptions
        Parameters:
        name - Parameter name.
        value - Parameter value.
      • setQueryParam

        public RequestOptions setQueryParam​(java.lang.String name,
                                            boolean value)
        Description copied from interface: RequestOptions
        Adds a query parameter to the request URL.
        Specified by:
        setQueryParam in interface RequestOptions
        Parameters:
        name - Parameter name.
        value - Parameter value.
      • setQueryParam

        public RequestOptions setQueryParam​(java.lang.String name,
                                            int value)
        Description copied from interface: RequestOptions
        Adds a query parameter to the request URL.
        Specified by:
        setQueryParam in interface RequestOptions
        Parameters:
        name - Parameter name.
        value - Parameter value.
      • setQueryParamImpl

        private RequestOptions setQueryParamImpl​(java.lang.String name,
                                                 java.lang.Object value)
      • setTimeout

        public RequestOptions setTimeout​(double timeout)
        Description copied from interface: RequestOptions
        Sets request timeout in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
        Specified by:
        setTimeout in interface RequestOptions
        Parameters:
        timeout - Request timeout in milliseconds.
      • setFailOnStatusCode

        public RequestOptions setFailOnStatusCode​(boolean failOnStatusCode)
        Specified by:
        setFailOnStatusCode in interface RequestOptions
        Parameters:
        failOnStatusCode - Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
      • setIgnoreHTTPSErrors

        public RequestOptions setIgnoreHTTPSErrors​(boolean ignoreHTTPSErrors)
        Specified by:
        setIgnoreHTTPSErrors in interface RequestOptions
        Parameters:
        ignoreHTTPSErrors - Whether to ignore HTTPS errors when sending network requests.
      • setMaxRedirects

        public RequestOptions setMaxRedirects​(int maxRedirects)
        Specified by:
        setMaxRedirects in interface RequestOptions
        Parameters:
        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.