2

Is there any equivalence in C++ to the following code in Java?

String url = "http://166.111.1.2/sensor?index=" + index_value;
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet( url );
HttpResponse response = client.execute( request );

I want to impletement the http request in my C++ code on Linux, but I cannot find a way to do it. I can use the HttpClient Class on Windows platform though.

NickWest
  • 63
  • 1
  • 4

1 Answers1

2

The short answer is that there is nothing built into C++ to handle HTTP requests. You will need to use a third party or open source library like quantdev has suggested.

.NET has the class as you noted, but that is not part of the C++11 standard.

Brian S
  • 3,096
  • 37
  • 55