std.net.curl and HTTP.responseHeaders
Vindex
tech.vindex at gmail.com
Wed Feb 3 19:25:18 UTC 2021
Header requests to Wikipedia give 405 error for some reason.
```
import std.stdio, std.net.curl;
void main() {
auto url = "https://en.wikipedia.org/wiki/Passenger_pigeon";
auto http = HTTP();
options(url, http);
writeln(http.responseHeaders);
}
```
Output:
```
std.net.curl.HTTPStatusException@/usr/include/dmd/phobos/std/net/curl.d(1097): HTTP request returned status code 405 ()
```
Perhaps some special HTTP configuration is needed?
More information about the Digitalmars-d-learn
mailing list