A Cheat Sheet for HTTP Libraries in C++

Unfortunately, standard C++ library provides no tools for working with HTTP protocol. Therefore, when we want to run some REST service, parse a webpage or write a simple bot or web crawler, we always wonder which library is better and faster in use. Sometimes a project already uses some framework (or even several). But how do we create an HTTP request using available facilities? Not to get confused each time performing such tasks, I decided to make a cheat sheet with examples of HTTP requests in C++ using different libraries. I guess Kukuruku is the best place for keeping such cheat sheets.

We’re going to take a look at the following libraries:

  • WinInet
  • WinHttp
  • Casablanca
  • Qt
  • POCO
  • wxWidgets
  • Boost.Asio
  • libcurl
  • neon
  • .NET (С++/CLI)
  • IXMLHTTPRequest
  • HappyHttp
  • cpp-netlib

WinInet

Website: http://msdn.microsoft.com/en-us/library/windows/desktop/aa385483(v=vs.85).aspx
Platform: Windows 95 and later
Example

WinHttp

Website: http://msdn.microsoft.com/en-us/library/windows/desktop/aa382925(v=vs.85).aspx
Platform: Windows 2000 and later
Example

Casablanca

Website: https://casablanca.codeplex.com
Platform: all
Example

Qt

Website: http://qt-project.org
Platform: all
Example use for Qt 4.x (already outdated)
Example use for Qt 5.x

POCO

Website: http://pocoproject.org
Platform: all
Example

wxWidgets

Website: http://www.wxwidgets.org
Platform: all
Example

Boost.Asio

Website: http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio.html
Platform: all
Example

libcurl

Website: http://curl.haxx.se/libcurl
Platform: all
Example

neon

Website: http://www.webdav.org/neon
Platform: all
Example

.NET

Website: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx
Platform: Windows XP and later 
Example

IXMLHTTPRequest

Website: http://msdn.microsoft.com/en-us/library/ms759148(v=vs.85).aspx
Platform: Windows XP and later 
Example

HappyHttp

Website: http://scumways.com/happyhttp/happyhttp.html
Platform: all
Example

cpp-netlib

Website: http://cpp-netlib.org
Platform: all
Example

It’s High Time to Find Out the Perfect One!

If you want to use the trusted classics – use libcurl. If you’re writing an application with a visual interface – use Qt. For those writing in С++11, Casablanca is the best choice. If you’re writing under .NET, then you should use standard platform facilities. But if you’re writing something with no interface and besides an HTTP client you want to have various handy tools as well, use Boost or POCO.

时间: 2024-10-12 22:36:57

A Cheat Sheet for HTTP Libraries in C++的相关文章

IOS Application Security Testing Cheat Sheet

IOS Application Security Testing Cheat Sheet [hide] 1 DRAFT CHEAT SHEET - WORK IN PROGRESS 2 Introduction 3 Information gathering 4 Application traffic analysis 5 Runtime analysis 6 Insecure data storage 7 Tools 8 Related Articles 9 Authors and Prima

MySQL SQL Injection Cheat Sheet

MySQL SQL Injection Cheat Sheet Some useful syntax reminders for SQL Injection into MySQL databases- This post is part of a series of SQL Injection Cheat Sheets.  In this series, I've endevoured to tabulate the data to make it easier to read and to u

XSS (Cross Site Scripting) Prevention Cheat Sheet(XSS防护检查单)

本文是 XSS防御检查单的翻译版本 https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet 介绍 本文描述了一种恰当地使用输出转码或者转义(encoding or escaping)防御XSS攻击的简单积极模式. 尽管存在巨量XSS攻击方式,遵守一些简单的规则能够彻底防住这类严重的攻击. 本文不探讨XSS攻击的商业和技术影响. reflected and stored XSS 可以

转:PostgreSQL Cheat Sheet

PostgreSQL Cheat Sheet CREATE DATABASE CREATE DATABASE dbName; CREATE TABLE (with auto numbering integer id) CREATE TABLE tableName ( id serial PRIMARY KEY, name varchar(50) UNIQUE NOT NULL, dateCreated timestamp DEFAULT current_timestamp ); Add a pr

A printf format reference page (cheat sheet)

Summary: This page is a printf formatting cheat sheet. I originally created this cheat sheet for my own purposes, and then thought I would share it here. A cool thing about the printf formatting syntax is that the specifiers you can use are very simi

The iOS Design Cheat Sheet 界面设计速参

http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/ With the release of iOS 7, app designers and developers will need to adjust their visual language to match the new "flat" design of iOS. In addition to the grid system, the dimensions of

Windows平台Atom编辑器的常用快捷键小抄Cheat Sheet

博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:Windows平台Atom编辑器的常用快捷键小抄Cheat Sheet. Windows平台Atom编辑器的常用快捷键小抄Cheat Sheet

[转]Swift Cheat Sheet

原文:http://kpbp.github.io/swiftcheatsheet/ A quick cheat sheet and reference guide for Apple's Swift language. This guide intends to cover all the key features of Swift, including Strings, Arrays, Dictionaries and Flow Control. Swift is a new programm

微软推 Azure 机器学习工具:Algorithm Cheat Sheet

微软推 Azure 机器学习工具:Algorithm Cheat Sheet [日期:2015-05-15] 来源:CSDN  作者:Linux [字体:大 中 小] Azure Machine Learning Studio 有着大量的机器学习算法,现在你可以使用它来构建预测分析解决方案.这些算法可用于一般的机器学习:回归分析.分类.聚类和异常检测,且每一个都可以解决不同类型的机器学习问题. 现在的问题是,是否有什么工具之类的东西可帮助找出如何选择一个合适的机器学习算法,并根据具体的方案? 点