vendredi 2 mars 2018

Unable to Run CppRestsdk Example

I am trying to use get function in CPP Rest Sdk it is getting Successfully built but getting failed on running.

#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
using namespace utility;                    
using namespace web;                        
using namespace web::http;                  
using namespace web::http::client;          
using namespace concurrency::streams;       
int main(int argc, char* argv[])
{
    http_client client(L"http://www.fourthcoffee.com");//Failing Point. Tried many Examples but no Success.
    client.request(methods::GET).then([](http_response response)
    {
        if (response.status_code() == status_codes::OK)
        {
            auto body = response.extract_string().get();
            std::wcout << body << std::endl;



        }});
    std::cout << "Hello world!" << std::endl;
    system("PAUSE");
    return 0;


}

Aucun commentaire:

Enregistrer un commentaire