Package com.microsoft.playwright
Interface APIResponse
-
public interface APIResponse
APIResponse
class represents responses returned byAPIRequestContext.get()
and similar methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
body()
Returns the buffer with response body.void
dispose()
Disposes the body of this response.Map<String,String>
headers()
An object with all the response HTTP headers associated with this response.List<HttpHeader>
headersArray()
An array with all the request HTTP headers associated with this response.boolean
ok()
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.int
status()
Contains the status code of the response (e.g., 200 for a success).String
statusText()
Contains the status text of the response (e.g.String
text()
Returns the text representation of response body.String
url()
Contains the URL of the response.
-
-
-
Method Detail
-
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
Map<String,String> 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
-
-