Package com.microsoft.playwright.impl
Class APIResponseImpl
java.lang.Object
com.microsoft.playwright.impl.APIResponseImpl
- All Implemented Interfaces:
APIResponse
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final APIRequestContextImplprivate final RawHeadersprivate final com.google.gson.JsonObject -
Constructor Summary
ConstructorsConstructorDescriptionAPIResponseImpl(APIRequestContextImpl apiRequestContext, com.google.gson.JsonObject response) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]body()Returns the buffer with response body.voiddispose()Disposes the body of this response.fetchLog()(package private) StringfetchUid()headers()An object with all the response HTTP headers associated with this response.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).Contains the status text of the response (e.g.text()Returns the text representation of response body.url()Contains the URL of the response.
-
Field Details
-
context
-
initializer
private final com.google.gson.JsonObject initializer -
headers
-
-
Constructor Details
-
APIResponseImpl
APIResponseImpl(APIRequestContextImpl apiRequestContext, com.google.gson.JsonObject response)
-
-
Method Details
-
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
Description copied from interface:APIResponseAn object with all the response HTTP headers associated with this response.- Specified by:
headersin interfaceAPIResponse
-
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
Description copied from interface:APIResponseContains the status text of the response (e.g. usually an "OK" for a success).- Specified by:
statusTextin interfaceAPIResponse
-
text
Description copied from interface:APIResponseReturns the text representation of response body.- Specified by:
textin interfaceAPIResponse
-
url
Description copied from interface:APIResponseContains the URL of the response.- Specified by:
urlin interfaceAPIResponse
-
fetchUid
String fetchUid() -
fetchLog
-