From db6f95f4b716510113d0e8e821984d80a89714e2 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sun, 12 Oct 2025 20:34:30 -0400 Subject: [PATCH] convenience method --- http2.d | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/http2.d b/http2.d index acc7368..0e8c0f2 100644 --- a/http2.d +++ b/http2.d @@ -1049,6 +1049,16 @@ class HttpRequest { this(null, where, method, cache, timeout, proxy); } + /++ + Adds the given header to the request, without checking for duplicates or similar. + + History: + Added October 8, 2025. Previously, you'd have to do `request.requestParameters.headers ~= "Name: Value"` (which is exactly what this does, but less conveniently). + +/ + void addHeader(string name, string value) { + this.requestParameters.headers ~= name ~ ": " ~ value; + } + /++ Sets the timeout from inactivity on the request. This is the amount of time that passes with no send or receive activity on the request before it fails with "request timed out" error.