On Sat, 18 Jan 2014 21:02:54 GMT, ilya-stromberg wrote:

For example, I have this code:

import vibe.core.log;
import vibe.http.client;
import vibe.stream.operations;

void test()
{
	requestHTTP(`http://username:password@127.0.0.1:1234",
		(scope req) {
			req.method = HTTPMethod.POST;
			req.writeJsonBody(["name": "My Name"]);
		},
		(scope res) {
			logInfo("Response: %s", res.bodyReader.readAllUTF8());
		}
	);
}

It doesn't work, I have the error 401 Unauthorized.. Note that the same code works fine via std.net.curl.

Am I miss something, or Vibe.d's vibe.http.client.requestHTTP haven't got support of authorised requests?

Is the server on the other hand also a vibe.d based server? I could imagine that URL based passwords are not fully supported in some areas, will look into it.

To use header based basic auth instead, you can call req.addBasicAuth(username, password) (needs import vibe.http.auth.basic_auth;).