使用ACCESS TOKEN提升asio c ++方法帖子

时间:2017-04-06 09:43:15

标签: c++ boost

我尝试将Post请求发送到具有令牌访问权限的Web服务器,但我收到了#34; 400 Bad Request" 对于接收访问令牌,一切都很好(在Get中),但是为了接收其他信息,我无法正确写入请求:

        request_stream << "POST "<<path<<"access_token="<<token<<" HTTP/1.0 \r\n";
        request_stream << "Host:" << host << "\r\n";
        //request_stream << "Authorization: Basic "<<token
        request_stream << "Content-Type: application/json; charset=utf-8 \r\n";
        request_stream << "Accept: */*\r\n";
        request_stream << "Content-Length: " << json55.length() << "\r\n";
        request_stream << "Connection: close\r\n\r\n";  //NOTE THE Double line feed
        request_stream << json55;

我在boost asio librairy(c ++)的所有文档中搜索了但没有关于此案例的任何信息

坦克寻求帮助

0 个答案:

没有答案