public abstract static class Net.Response
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Net.Response.Binary
Used to deliver binary response data.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
header(java.lang.String name)
Returns the value of the header with the specified name, or null.
|
java.lang.Iterable<java.lang.String> |
headerNames()
Returns the names of all headers returned by the server.
|
java.util.List<java.lang.String> |
headers(java.lang.String name)
Returns the value of all headers with the specified name, or the empty list.
|
byte[] |
payload()
Returns the response payload as raw bytes.
|
Image |
payloadImage(Scale scale)
Returns the response payload as an
Image. |
abstract java.lang.String |
payloadString()
Returns the response payload as a string, decoded using the character set specified in the
response's content type.
|
int |
responseCode()
Returns the HTTP response code provided by the server.
|
public int responseCode()
public java.lang.Iterable<java.lang.String> headerNames()
public java.lang.String header(java.lang.String name)
public java.util.List<java.lang.String> headers(java.lang.String name)
NOTE: on the iOS backend, repeated headers will be coalesced into a single header separated by commas. This sucks but we can't "undo" the coalescing without breaking otherwise normal headers that happent to contain commas. Complain to Apple.
public abstract java.lang.String payloadString()
public byte[] payload()
public Image payloadImage(Scale scale) throws java.lang.Exception
Image. Note: this is not available on the HTML
backend.scale - the scale to use for the loaded image. Probably Scale.ONE unless you
know you're loading a HiDPI image.java.lang.Exception - if image decoding fails.Copyright © 2018. All Rights Reserved.