public class CdpRequest extends Request
failureText, fromMemoryCache, interception, interceptionId, redirectChain, response, STATUS_TEXTS| 构造器和说明 |
|---|
CdpRequest(CDPSession client,
Frame frame,
String interceptionId,
boolean allowInterception,
RequestWillBeSentEvent event,
List<Request> redirectChain) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
_abort(ErrorReasons errorCode) |
void |
_continue(ContinueRequestOverrides overrides)
拦截请求时,该方法表示放行请求
|
void |
_respond(ResponseForRequest response)
使用给定的响应来满足请求。
|
CDPSession |
client() |
String |
failure()
访问有关请求失败的信息。
|
String |
fetchPostData()
从浏览器获取请求的 POST 数据。
|
Frame |
frame() |
boolean |
fromMemoryCache() |
boolean |
hasPostData()
是否有请求体
当请求有 POST 数据时为 true。
|
List<HeaderEntry> |
headers()
具有与请求关联的 HTTP 标头的对象。
|
String |
id() |
Initiator |
initiator()
请求的发起者。
|
String |
interceptionId() |
boolean |
isNavigationRequest()
如果请求是当前帧导航的驱动程序,则为 True。
|
String |
method()
使用的方法(GET、POST 等)
|
String |
postData()
请求体数据
|
List<Request> |
redirectChain()
重定向链
redirectChain 是为获取资源而发起的请求链。
|
ResourceType |
resourceType()
包含渲染引擎感知到的请求的资源类型。
|
CdpResponse |
response()
请求对应的响应
|
void |
setClient(CDPSession client) |
protected void |
setFailureText(String failureText) |
void |
setHeaders(List<HeaderEntry> headers) |
protected void |
setResponse(CdpResponse response) |
String |
url()
请求的 URL
|
String |
url(boolean withFragment) |
abort, abort, abortErrorReason, canBeIntercepted, continueRequest, continueRequest, continueRequest, continueRequestOverrides, enqueueInterceptAction, finalizeInterceptions, handleError, interceptResolutionState, isInterceptResolutionHandled, respond, respond, responseForRequest, setFromMemoryCachepublic CdpRequest(CDPSession client, Frame frame, String interceptionId, boolean allowInterception, RequestWillBeSentEvent event, List<Request> redirectChain)
public CDPSession client()
public String url(boolean withFragment)
public ResourceType resourceType()
RequestresourceType 在类中 Requestpublic boolean hasPostData()
当请求有 POST 数据时为 true。
请注意,当数据太长或不易以解码形式提供时,当此标志为真时,HTTPRequest.postData() 可能仍然未定义。
在这种情况下,请使用 HTTPRequest.fetchPostData()。
hasPostData 在类中 Requestpublic String fetchPostData()
fetchPostData 在类中 Requestpublic List<HeaderEntry> headers()
public CdpResponse response()
public void setHeaders(List<HeaderEntry> headers)
public boolean isNavigationRequest()
isNavigationRequest 在类中 Requestpublic List<Request> redirectChain()
redirectChain 是为获取资源而发起的请求链。
请求链 - 如果服务器至少响应一个重定向,则该链将包含所有重定向的请求。redirectChain 在类中 Requestpublic String failure()
public void _continue(ContinueRequestOverrides overrides)
Requestpublic void _respond(ResponseForRequest response)
Requestpublic void _abort(ErrorReasons errorCode)
public String interceptionId()
protected void setResponse(CdpResponse response)
protected void setFailureText(String failureText)
public boolean fromMemoryCache()
public void setClient(CDPSession client)
Copyright © 2020–2025. All rights reserved.