mirror of https://github.com/adamdruppe/arsd.git
convenience method
This commit is contained in:
parent
23dadb8e1d
commit
db6f95f4b7
10
http2.d
10
http2.d
|
|
@ -1049,6 +1049,16 @@ class HttpRequest {
|
||||||
this(null, where, method, cache, timeout, proxy);
|
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.
|
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.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue