Package com.microsoft.playwright
Interface APIResponse
- All Known Implementing Classes:
APIResponseImpl
public interface APIResponse
APIResponse class represents responses returned by APIRequestContext.get() and
similar methods.-
Method Summary
Modifier and TypeMethodDescriptionbyte[]body()Returns the buffer with response body.voiddispose()Disposes the body of this response.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.
-
Method Details
-
body
byte[] body()Returns the buffer with response body.- Since:
- v1.16
-
dispose
void dispose()Disposes the body of this response. If not called then the body will stay in memory until the context closes.- Since:
- v1.16
-
headers
An object with all the response HTTP headers associated with this response.- Since:
- v1.16
-
headersArray
List<HttpHeader> headersArray()An 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.- Since:
- v1.16
-
ok
boolean ok()Contains a boolean stating whether the response was successful (status in the range 200-299) or not.- Since:
- v1.16
-
status
int status()Contains the status code of the response (e.g., 200 for a success).- Since:
- v1.16
-
statusText
String statusText()Contains the status text of the response (e.g. usually an "OK" for a success).- Since:
- v1.16
-
text
String text()Returns the text representation of response body.- Since:
- v1.16
-
url
String url()Contains the URL of the response.- Since:
- v1.16
-