C++ 通过卡萨布兰卡库与github API交互

C++ 通过卡萨布兰卡库与github API交互,c++,github,casablanca,C++,Github,Casablanca,我正在MFC框架中构建Git客户端,我正在使用casablanca库与github服务器建立连接并使用其API。在Github教程中,一个示例演示了如何向Github服务器发送请求,并附上用户名和密码以进行身份验证: 现在,我已经试着用微软的卡萨布兰卡(casablanca)实现同样的效果,但我根本无法正确使用语法: http_client client(U("https://api.github.com/users/myuser")); uri_builder builder(U("- u

我正在MFC框架中构建Git客户端,我正在使用casablanca库与github服务器建立连接并使用其API。在Github教程中,一个示例演示了如何向Github服务器发送请求,并附上用户名和密码以进行身份验证:

现在,我已经试着用微软的卡萨布兰卡(casablanca)实现同样的效果,但我根本无法正确使用语法:

http_client client(U("https://api.github.com/users/myuser"));
uri_builder builder(U("- u myuser:mypass"));
pplx::task<http_response> requestTask = client.request(methods::GET, builder.to_string());  
http_客户端(U)https://api.github.com/users/myuser"));
uri_生成器(U(“-U myuser:mypass”);
pplx::task requestTask=client.request(方法::GET,builder.to_string());
调用此函数后,卡萨布兰卡抛出异常,表示uri无效。
知道如何在卡萨布兰卡中正确构造请求以便将其发送到github服务器吗?

谢谢。

在GitHub页面的示例中,
-u username:password
是curl的一个选项:

-u/--user <user:password> 

    Specify the user name and password to use for server authentication.
-u/--用户
指定用于服务器身份验证的用户名和密码。

可以使用C++ .REST SDK使用.< /P>进行基本身份验证 (另见相关问题:)

-u/--user <user:password> 

    Specify the user name and password to use for server authentication.