From 973d5ab620fa9868b204f4edbf2d48da22497212 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 18 Oct 2010 11:53:47 +0200 Subject: [PATCH] Add method to set a header. --- src/main/java/net/pterodactylus/sone/web/page/Page.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/page/Page.java b/src/main/java/net/pterodactylus/sone/web/page/Page.java index 7a9b281..195742b 100644 --- a/src/main/java/net/pterodactylus/sone/web/page/Page.java +++ b/src/main/java/net/pterodactylus/sone/web/page/Page.java @@ -307,6 +307,21 @@ public interface Page { } /** + * 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 + */ + public void setHeader(String name, String value) { + headers.put(name, value); + } + + /** * Returns the content of the response body. May be {@code null} if the * response does not have a body. * -- 2.7.4