Class CefRequest


  • public abstract class CefRequest
    extends java.lang.Object
    Class used to represent a web request. The methods of this class may be called on any thread.
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • create

        public static final CefRequest create()
        Create a new CefRequest object.
      • dispose

        public abstract void dispose()
        Removes the native reference from an unused object.
      • getIdentifier

        public abstract long getIdentifier()
        Returns the globally unique identifier for this request or 0 if not specified. Can be used by CefRequestHandler implementations in the browser process to track a single request across multiple callbacks.
      • isReadOnly

        public abstract boolean isReadOnly()
        Returns true if this object is read-only.
      • getURL

        public abstract java.lang.String getURL()
        Get the fully qualified URL.
      • setURL

        public abstract void setURL​(java.lang.String url)
        Set the fully qualified URL.
      • getMethod

        public abstract java.lang.String getMethod()
        Get the request method type. The value will default to POST if post data is provided and GET otherwise.
      • setMethod

        public abstract void setMethod​(java.lang.String method)
        Set the request method type.
      • setReferrer

        public abstract void setReferrer​(java.lang.String url,
                                         CefRequest.ReferrerPolicy policy)
        Set the referrer URL and policy. If non-empty the referrer URL must be fully qualified with an HTTP or HTTPS scheme component. Any username, password or ref component will be removed.
      • getReferrerURL

        public abstract java.lang.String getReferrerURL()
        Get the referrer URL.
      • getPostData

        public abstract CefPostData getPostData()
        Get the post data.
      • setPostData

        public abstract void setPostData​(CefPostData postData)
        Set the post data.
      • getHeaderByName

        public abstract java.lang.String getHeaderByName​(java.lang.String name)
        Get the value for the specified response header field. The Referer value cannot be retrieved using this method. Use getHeaderMap instead if there might be multiple values.
        Parameters:
        name - The header name.
        Returns:
        The header value.
      • setHeaderByName

        public abstract void setHeaderByName​(java.lang.String name,
                                             java.lang.String value,
                                             boolean overwrite)
        Set the value for the specified response header field. The Referer value cannot be set using this method.
        Parameters:
        name - The header name.
        value - The header value.
        overwrite - If true any existing values will be replaced with the new value. If false any existing values will not be overwritten.
      • getHeaderMap

        public abstract void getHeaderMap​(java.util.Map<java.lang.String,​java.lang.String> headerMap)
        Get the header values.
      • setHeaderMap

        public abstract void setHeaderMap​(java.util.Map<java.lang.String,​java.lang.String> headerMap)
        Set the header values.
      • set

        public abstract void set​(java.lang.String url,
                                 java.lang.String method,
                                 CefPostData postData,
                                 java.util.Map<java.lang.String,​java.lang.String> headerMap)
        Set all values at one time.
      • getFlags

        public abstract int getFlags()
        Get the flags used in combination with CefURLRequest. See CefUrlRequestFlags for supported values.
      • setFlags

        public abstract void setFlags​(int flags)
        Set the flags used in combination with CefURLRequest. See CefUrlRequestFlags for supported values.
      • getFirstPartyForCookies

        public abstract java.lang.String getFirstPartyForCookies()
        Get the URL to the first party for cookies used in combination with CefURLRequest.
      • setFirstPartyForCookies

        public abstract void setFirstPartyForCookies​(java.lang.String url)
        Set the URL to the first party for cookies used in combination with CefURLRequest.
      • getResourceType

        public abstract CefRequest.ResourceType getResourceType()
        Get the resource type for this request. Accurate resource type information may only be available in the browser process.
      • getTransitionType

        public abstract CefRequest.TransitionType getTransitionType()
        Get the transition type for this request. Only available in the browser process and only applies to requests that represent a main frame or sub-frame navigation.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object