How to use HttpClient in CLI c++?

  c++, c++-cli
#include "pch.h"
#include <iostream>

using namespace System;
using namespace System;
using namespace System::Net::Http;
using namespace System::Threading::Tasks;

int main(array<System::String ^> ^args)
{
    

    HttpClient ^client = gcnew HttpClient();

    Task<System::Net::Http::HttpResponseMessage^> ^c = client->GetAsync ("http://www.google.com");
    //what to do next?

    return 0;
}



I found this
https://paoloseverini.wordpress.com/2014/04/22/async-await-in-c/
but not understand.

Source: Windows Questions C++

LEAVE A COMMENT