public interface Response
Response
class represents responses which are received by page.Modifier and Type | Method and Description |
---|---|
Map<String,String> |
allHeaders()
An object with all the response HTTP headers associated with this response.
|
byte[] |
body()
Returns the buffer with response body.
|
String |
finished()
Waits for this response to finish, returns always
null . |
Frame |
frame()
Returns the
Frame that initiated this response. |
Map<String,String> |
headers()
**DEPRECATED** Incomplete list of headers as seen by the rendering engine.
|
List<HttpHeader> |
headersArray()
An array with all the request HTTP headers associated with this response.
|
String |
headerValue(String name)
Returns the value of the header matching the name.
|
List<String> |
headerValues(String name)
Returns all values of the headers matching the name, for example
set-cookie . |
boolean |
ok()
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
|
Request |
request()
Returns the matching
Request object. |
SecurityDetails |
securityDetails()
Returns SSL and other security information.
|
ServerAddr |
serverAddr()
Returns the IP address and port of the server.
|
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.
|
Map<String,String> allHeaders()
byte[] body()
String finished()
null
.Frame frame()
Frame
that initiated this response.Map<String,String> headers()
Response.allHeaders()
instead.List<HttpHeader> headersArray()
Response.allHeaders()
, header names are NOT lower-cased. Headers with multiple entries, such as Set-Cookie
, appear in
the array multiple times.String headerValue(String name)
set-cookie
), they are returned as a list separated by ,
. For set-cookie
, the \n
separator is used. If
no headers are found, null
is returned.name
- Name of the header.List<String> headerValues(String name)
set-cookie
. The name is case insensitive.name
- Name of the header.boolean ok()
Request request()
Request
object.SecurityDetails securityDetails()
ServerAddr serverAddr()
int status()
String statusText()
String text()
String url()
Copyright © 2022. All rights reserved.