Package org.cef.network
Class CefRequest
- java.lang.Object
-
- org.cef.network.CefRequest
-
public abstract class CefRequest extends java.lang.ObjectClass 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 classCefRequest.CefUrlRequestFlagsstatic classCefRequest.ReferrerPolicyPolicy for how the Referrer HTTP header value will be sent during navigation.static classCefRequest.ResourceTypeResource type for a request.static classCefRequest.TransitionFlagsTransition qualifiers.static classCefRequest.TransitionTypeTransition type for a request.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CefRequestcreate()Create a new CefRequest object.abstract voiddispose()Removes the native reference from an unused object.protected voidfinalize()abstract java.lang.StringgetFirstPartyForCookies()Get the URL to the first party for cookies used in combination with CefURLRequest.abstract intgetFlags()Get the flags used in combination with CefURLRequest.abstract java.lang.StringgetHeaderByName(java.lang.String name)Get the value for the specified response header field.abstract voidgetHeaderMap(java.util.Map<java.lang.String,java.lang.String> headerMap)Get the header values.abstract longgetIdentifier()Returns the globally unique identifier for this request or 0 if not specified.abstract java.lang.StringgetMethod()Get the request method type.abstract CefPostDatagetPostData()Get the post data.abstract CefRequest.ReferrerPolicygetReferrerPolicy()Get the referrer policy.abstract java.lang.StringgetReferrerURL()Get the referrer URL.abstract CefRequest.ResourceTypegetResourceType()Get the resource type for this request.abstract CefRequest.TransitionTypegetTransitionType()Get the transition type for this request.abstract java.lang.StringgetURL()Get the fully qualified URL.abstract booleanisReadOnly()Returns true if this object is read-only.abstract voidset(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 voidsetFirstPartyForCookies(java.lang.String url)Set the URL to the first party for cookies used in combination with CefURLRequest.abstract voidsetFlags(int flags)Set the flags used in combination with CefURLRequest.abstract voidsetHeaderByName(java.lang.String name, java.lang.String value, boolean overwrite)Set the value for the specified response header field.abstract voidsetHeaderMap(java.util.Map<java.lang.String,java.lang.String> headerMap)Set the header values.abstract voidsetMethod(java.lang.String method)Set the request method type.abstract voidsetPostData(CefPostData postData)Set the post data.abstract voidsetReferrer(java.lang.String url, CefRequest.ReferrerPolicy policy)Set the referrer URL and policy.abstract voidsetURL(java.lang.String url)Set the fully qualified URL.java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-