Skip to content

planed-es/QtCurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QtCurl

A simple wrapper around libcurl's easy interface. Allows you to send requests via curl using QNetworkRequest, and receive the response as a QNetworkReply.

#include <qcurl.h>
#include <QDebug>

int main(int argc, const char** argv)
{
  QCurl curl;
  QNetworkRequest request;
  QNetworkReply* reply;

  request.setUrl(QUrl("https://duckduckgo.com"));
  reply = curl.send(request);
  if (reply)
  {
    qDebug() << "Received response:"
      << "status=" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toUInt()
      << "body=" << reply->readAll();
    return 0;
  }
  else
    qDebug() << "QCurl could not send the request";
  return -1;
}

About

Simple wrapper around libcurl for Qt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published