*
* @return The accessed URI
*/
- public URI getURI() {
+ public URI getUri() {
return uri;
}
* The content of the reponse body
*/
public Response(int statusCode, String statusText, String contentType, byte[] content) {
- this(statusCode, statusText, contentType, null, content);
+ this(statusCode, statusText, contentType, new HashMap<String, String>(), content);
}
/**
}
/**
+ * Sets the HTTP header with the given name to the given value. Multiple
+ * headers with the same name are not implemented so that latest call to
+ * {@link #setHeader(String, String)} determines what is sent to the
+ * browser.
+ *
+ * @param name
+ * The name of the header
+ * @param value
+ * The value of the header
+ * @return This response
+ */
+ public Response setHeader(String name, String value) {
+ headers.put(name, value);
+ return this;
+ }
+
+ /**
* Returns the content of the response body. May be {@code null} if the
* response does not have a body.
*