April 15, 2017 std.net.curl: how to abort operation | ||||
---|---|---|---|---|
| ||||
I want to abort a download, if a condition inside of onReceiveHeader is true. The following code do the job, but it feels very wrong - is there a better/proper way to do such a thing? client.onReceiveHeader = (in char[] key, in char[] value) { if(key == "content-type") { if( -1 == value.indexOf("text" ,0, No.caseSensitive) ) { throw new ContentTypeException("No Text"); } } }; |
Copyright © 1999-2021 by the D Language Foundation