On Fri, 25 Apr 2014 16:17:57 GMT, Darius Clark wrote:

Hi,

I am currently getting an error when using requestHTTP

function vibe.http.client.requestHTTP (string url, scope void delegate(scope HTTPClientRequest req) requester = null) is not callable using argument types (string, void, void)

It points to the line where the url is at in the requestHTTP function

...

Any clue to why this is happening? If I am to remove the line where the callback varable is located it compiles without errors.

Sometimes the error messages are a bit misleading when multiple overloads and anonymous delegates are involved. It could be that there is actually a compile error in the callback = line. One way to test that would be to use a nested function instead and see if the error message changes:

void resHandler(scope HTTPClientResponse res) {
	if(res.statusCode is 200){
		ExampleTemplate callback =  deserializeJson!ExampleTemplate(parseJsonString(res.bodyReader.readAllUTF8()));
	}
}

requestHTTP(callurl,
	(scope req) {
	},
	&resHandler
);

BTW, parseJsonString(res.bodyReader.readAllUTF8()) can also be replaced by res.readJson().