私はUbuntu 16.04でCasablancaと他のすべての依存関係を正しく構築しました。しかし、私がthisサイトのこれらのC++の例に従うと、プログラムはmethods::GET
というメンバーを見つけることができませんでした。 methods
のみ表示されますが、その子メンバーはありません。私は何を取りこぼしたか? ありがとうございます。メソッド:: GETがC++ RESTに見つかりません
更新:
は、ここで私が使用したコードです:
#include <http_client.h>
#include <filestream.h>
#include <iostream>
#include <sstream>
using namespace web::http;
using namespace web::http::client;
// Creates an HTTP request and prints the length of the response stream.
pplx::task<void> HTTPStreamingAsync()
{
http_client client(L"http://myAddressComesHere");
// Make the request and asynchronously process the response.
return client.request(methods::GET).then([](http_response response)
{
// Print the status code.
std::wostringstream ss;
ss << L"Server returned returned status code " << response.status_code() << L'.' << std::endl;
std::wcout << ss.str();
// TODO: Perform actions here reading from the response stream.
auto bodyStream = response.body();
// In this example, we print the length of the response to the console.
ss.str(std::wstring());
ss << L"Content length is " << response.headers().content_length() << L" bytes." << std::endl;
std::wcout << ss.str();
});
}
[mcve]を入力してください。 – Ron
のメソッドはweb :: httpの一部ですので、与えられた例を使用したい場合は、web :: httpまたはweb :: http :: methods :: GETのメソッド:: GETを置き換えます。それはあなたの問題ですか? – Gibet
私はすでにやりました。私が参照したリンクからわかるように、私は前にその名前空間を批判しました。 –