How to curl!

IntegratedDimensions IntegratedDimensions at
Tue May 1 21:57:22 UTC 2018

Trying to curl basic stuff but isn't cooperating:

curl "" -G -d 
part=contentDetails -d forUsername=test -d key=somekey

import std.stdio;

int main(string[] argv)
	auto http = HTTP();
	http.caInfo("cacert.pem"); // cacert.pem installed in the bin dir
	http.handle.set(CurlOption.ssl_verifypeer, 1);

	auto content = 
post("", ["part" : 
"contentDetails", "forUsername" : "test", "key" : "somekey"], 

     return 0;

I either get the error

Unhandled exception: Peer certificate 
cannot be authenticated with given CA certificates on handle at 

or, when verifypeer is 0,

Unhandled exception: HTTP 
request returned status code 404 (Not Found)

But the command line version works fine. (of course, if you want 
to test you must use a valid key and youtube user name.

This is one of the reasons I hate D ;/ I've spent more time 
trying to get to do something that just works from 
the command line.

More information about the Digitalmars-d-learn mailing list