Package com.microsoft.playwright.impl
Class ResponseImpl
- java.lang.Object
-
- com.microsoft.playwright.impl.LoggingSupport
-
- com.microsoft.playwright.impl.ChannelOwner
-
- com.microsoft.playwright.impl.ResponseImpl
-
- All Implemented Interfaces:
Response
public class ResponseImpl extends ChannelOwner implements Response
-
-
Field Summary
Fields Modifier and Type Field Description private RawHeadersheadersprivate RawHeadersrawHeadersprivate RequestImplrequest-
Fields inherited from class com.microsoft.playwright.impl.ChannelOwner
connection, guid, initializer, type
-
-
Constructor Summary
Constructors Constructor Description ResponseImpl(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>allHeaders()An object with all the response HTTP headers associated with this response.byte[]body()Returns the buffer with response body.java.lang.Stringfinished()Waits for this response to finish, returns alwaysnull.Frameframe()Returns theFramethat initiated this response.booleanfromServiceWorker()Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e.private RawHeadersgetRawHeaders()java.util.Map<java.lang.String,java.lang.String>headers()An object with the response HTTP headers.java.util.List<HttpHeader>headersArray()An array with all the request HTTP headers associated with this response.java.lang.StringheaderValue(java.lang.String name)Returns the value of the header matching the name.java.util.List<java.lang.String>headerValues(java.lang.String name)Returns all values of the headers matching the name, for exampleset-cookie.booleanok()Contains a boolean stating whether the response was successful (status in the range 200-299) or not.RequestImplrequest()Returns the matchingRequestobject.SecurityDetailssecurityDetails()Returns SSL and other security information.ServerAddrserverAddr()Returns the IP address and port of the server.intstatus()Contains the status code of the response (e.g., 200 for a success).java.lang.StringstatusText()Contains the status text of the response (e.g.java.lang.Stringtext()Returns the text representation of response body.java.lang.Stringurl()Contains the URL of the response.-
Methods inherited from class com.microsoft.playwright.impl.ChannelOwner
adopt, disposeChannelOwner, handleEvent, runUntil, sendMessage, sendMessage, sendMessageAsync, toProtocolRef, withLogging, withWaitLogging
-
Methods inherited from class com.microsoft.playwright.impl.LoggingSupport
logApi, logApiIfEnabled, logWithTimestamp, withLogging
-
-
-
-
Field Detail
-
headers
private final RawHeaders headers
-
rawHeaders
private RawHeaders rawHeaders
-
request
private final RequestImpl request
-
-
Constructor Detail
-
ResponseImpl
ResponseImpl(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
-
Method Detail
-
allHeaders
public java.util.Map<java.lang.String,java.lang.String> allHeaders()
Description copied from interface:ResponseAn object with all the response HTTP headers associated with this response.- Specified by:
allHeadersin interfaceResponse
-
body
public byte[] body()
Description copied from interface:ResponseReturns the buffer with response body.
-
finished
public java.lang.String finished()
Description copied from interface:ResponseWaits for this response to finish, returns alwaysnull.
-
frame
public Frame frame()
Description copied from interface:ResponseReturns theFramethat initiated this response.
-
fromServiceWorker
public boolean fromServiceWorker()
Description copied from interface:ResponseIndicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via FetchEvent.respondWith).- Specified by:
fromServiceWorkerin interfaceResponse
-
headers
public java.util.Map<java.lang.String,java.lang.String> headers()
Description copied from interface:ResponseAn object with the response HTTP headers. The header names are lower-cased. Note that this method does not return security-related headers, including cookie-related ones. You can useResponse.allHeaders()for complete list of headers that includecookieinformation.
-
headersArray
public java.util.List<HttpHeader> headersArray()
Description copied from interface:ResponseAn array with all the request HTTP headers associated with this response. UnlikeResponse.allHeaders(), header names are NOT lower-cased. Headers with multiple entries, such asSet-Cookie, appear in the array multiple times.- Specified by:
headersArrayin interfaceResponse
-
headerValue
public java.lang.String headerValue(java.lang.String name)
Description copied from interface:ResponseReturns the value of the header matching the name. The name is case insensitive. If multiple headers have the same name (exceptset-cookie), they are returned as a list separated by,. Forset-cookie, the\nseparator is used. If no headers are found,nullis returned.- Specified by:
headerValuein interfaceResponse- Parameters:
name- Name of the header.
-
headerValues
public java.util.List<java.lang.String> headerValues(java.lang.String name)
Description copied from interface:ResponseReturns all values of the headers matching the name, for exampleset-cookie. The name is case insensitive.- Specified by:
headerValuesin interfaceResponse- Parameters:
name- Name of the header.
-
ok
public boolean ok()
Description copied from interface:ResponseContains a boolean stating whether the response was successful (status in the range 200-299) or not.
-
request
public RequestImpl request()
Description copied from interface:ResponseReturns the matchingRequestobject.
-
securityDetails
public SecurityDetails securityDetails()
Description copied from interface:ResponseReturns SSL and other security information.- Specified by:
securityDetailsin interfaceResponse
-
serverAddr
public ServerAddr serverAddr()
Description copied from interface:ResponseReturns the IP address and port of the server.- Specified by:
serverAddrin interfaceResponse
-
status
public int status()
Description copied from interface:ResponseContains the status code of the response (e.g., 200 for a success).
-
statusText
public java.lang.String statusText()
Description copied from interface:ResponseContains the status text of the response (e.g. usually an "OK" for a success).- Specified by:
statusTextin interfaceResponse
-
text
public java.lang.String text()
Description copied from interface:ResponseReturns the text representation of response body.
-
url
public java.lang.String url()
Description copied from interface:ResponseContains the URL of the response.
-
getRawHeaders
private RawHeaders getRawHeaders()
-
-