Package com.microsoft.playwright.impl
Class APIResponseImpl
- java.lang.Object
-
- com.microsoft.playwright.impl.APIResponseImpl
-
- All Implemented Interfaces:
APIResponse
class APIResponseImpl extends java.lang.Object implements APIResponse
-
-
Field Summary
Fields Modifier and Type Field Description (package private) APIRequestContextImplcontextprivate RawHeadersheadersprivate com.google.gson.JsonObjectinitializer
-
Constructor Summary
Constructors Constructor Description APIResponseImpl(APIRequestContextImpl apiRequestContext, com.google.gson.JsonObject response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]body()Returns the buffer with response body.voiddispose()Disposes the body of this response.(package private) java.util.List<java.lang.String>fetchLog()(package private) java.lang.StringfetchUid()java.util.Map<java.lang.String,java.lang.String>headers()An object with all the response HTTP headers associated with this response.java.util.List<HttpHeader>headersArray()An array with all the request HTTP headers associated with this response.booleanok()Contains a boolean stating whether the response was successful (status in the range 200-299) or not.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.
-
-
-
Field Detail
-
context
final APIRequestContextImpl context
-
initializer
private final com.google.gson.JsonObject initializer
-
headers
private final RawHeaders headers
-
-
Constructor Detail
-
APIResponseImpl
APIResponseImpl(APIRequestContextImpl apiRequestContext, com.google.gson.JsonObject response)
-
-
Method Detail
-
body
public byte[] body()
Description copied from interface:APIResponseReturns the buffer with response body.- Specified by:
bodyin interfaceAPIResponse
-
dispose
public void dispose()
Description copied from interface:APIResponseDisposes the body of this response. If not called then the body will stay in memory until the context closes.- Specified by:
disposein interfaceAPIResponse
-
headers
public java.util.Map<java.lang.String,java.lang.String> headers()
Description copied from interface:APIResponseAn object with all the response HTTP headers associated with this response.- Specified by:
headersin interfaceAPIResponse
-
headersArray
public java.util.List<HttpHeader> headersArray()
Description copied from interface:APIResponseAn array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers with multiple entries, such asSet-Cookie, appear in the array multiple times.- Specified by:
headersArrayin interfaceAPIResponse
-
ok
public boolean ok()
Description copied from interface:APIResponseContains a boolean stating whether the response was successful (status in the range 200-299) or not.- Specified by:
okin interfaceAPIResponse
-
status
public int status()
Description copied from interface:APIResponseContains the status code of the response (e.g., 200 for a success).- Specified by:
statusin interfaceAPIResponse
-
statusText
public java.lang.String statusText()
Description copied from interface:APIResponseContains the status text of the response (e.g. usually an "OK" for a success).- Specified by:
statusTextin interfaceAPIResponse
-
text
public java.lang.String text()
Description copied from interface:APIResponseReturns the text representation of response body.- Specified by:
textin interfaceAPIResponse
-
url
public java.lang.String url()
Description copied from interface:APIResponseContains the URL of the response.- Specified by:
urlin interfaceAPIResponse
-
fetchUid
java.lang.String fetchUid()
-
fetchLog
java.util.List<java.lang.String> fetchLog()
-
-