How do you make a HTTP request with C++?

后端 未结 22 2770
有刺的猬
有刺的猬 2020-11-22 06:25

Is there any way to easily make a HTTP request with C++? Specifically, I want to download the contents of a page (an API) and check the contents to see if it contains a 1 o

22条回答
  •  一个人的身影
    2020-11-22 06:51

    As you want a C++ solution, you could use Qt. It has a QHttp class you can use.

    You can check the docs:

    http->setHost("qt.nokia.com");
    http->get(QUrl::toPercentEncoding("/index.html"));
    

    Qt also has a lot more to it that you could use in a common C++ app.

提交回复
热议问题