digitalmars.D.learn - std.net.curl: how to abort operation
- mab (11/11) Apr 15 2017 I want to abort a download, if a condition inside of
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"); } } };
Apr 15 2017