April 26, 2020
Hi all,

I am using std.net.curl and would like to run a HEAD request to find out if a web page exists - I've looked at the documentation and have tried various things that haven't worked.

Thanks
April 26, 2020
On Sunday, 26 April 2020 at 22:03:33 UTC, data pulverizer wrote:
> Hi all,
>
> I am using std.net.curl and would like to run a HEAD request to find out if a web page exists - I've looked at the documentation and have tried various things that haven't worked.
>
> Thanks

Never mind, I've got it, the answer was in a previous issue: https://forum.dlang.org/post/mailman.301.1412409956.9932.digitalmars-d-bugs@puremagic.com

```
import std.net.curl;

void main()
{
    auto http = HTTP("dlang.org/non-existing-url");
    http.onReceiveStatusLine = (HTTP.StatusLine s) {
        if (s.code != 200)
            throw new Exception("Request failed.");
    };
    http.method = HTTP.Method.head;
    http.perform();
}
```