Package org.cef.network
Class CefRequest
- java.lang.Object
-
- org.cef.network.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CefRequest.CefUrlRequestFlags
static class
CefRequest.ReferrerPolicy
Policy for how the Referrer HTTP header value will be sent during navigation.static class
CefRequest.ResourceType
Resource type for a request.static class
CefRequest.TransitionFlags
Transition qualifiers.static class
CefRequest.TransitionType
Transition type for a request.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CefRequest
create()
Create a new CefRequest object.abstract void
dispose()
Removes the native reference from an unused object.protected void
finalize()
abstract java.lang.String
getFirstPartyForCookies()
Get the URL to the first party for cookies used in combination with CefURLRequest.abstract int
getFlags()
Get the flags used in combination with CefURLRequest.abstract java.lang.String
getHeaderByName(java.lang.String name)
Get the value for the specified response header field.abstract void
getHeaderMap(java.util.Map<java.lang.String,java.lang.String> headerMap)
Get the header values.abstract long
getIdentifier()
Returns the globally unique identifier for this request or 0 if not specified.abstract java.lang.String
getMethod()
Get the request method type.abstract CefPostData
getPostData()
Get the post data.abstract CefRequest.ReferrerPolicy
getReferrerPolicy()
Get the referrer policy.abstract java.lang.String
getReferrerURL()
Get the referrer URL.abstract CefRequest.ResourceType
getResourceType()
Get the resource type for this request.abstract CefRequest.TransitionType
getTransitionType()
Get the transition type for this request.abstract java.lang.String
getURL()
Get the fully qualified URL.abstract boolean
isReadOnly()
Returns true if this object is read-only.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.abstract void
setFirstPartyForCookies(java.lang.String url)
Set the URL to the first party for cookies used in combination with CefURLRequest.abstract void
setFlags(int flags)
Set the flags used in combination with CefURLRequest.abstract void
setHeaderByName(java.lang.String name, java.lang.String value, boolean overwrite)
Set the value for the specified response header field.abstract void
setHeaderMap(java.util.Map<java.lang.String,java.lang.String> headerMap)
Set the header values.abstract void
setMethod(java.lang.String method)
Set the request method type.abstract void
setPostData(CefPostData postData)
Set the post data.abstract void
setReferrer(java.lang.String url, CefRequest.ReferrerPolicy policy)
Set the referrer URL and policy.abstract void
setURL(java.lang.String url)
Set the fully qualified URL.java.lang.String
toString()
-
-
-
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.
-
getReferrerPolicy
public abstract CefRequest.ReferrerPolicy getReferrerPolicy()
Get the referrer policy.
-
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 classjava.lang.Object
-
-