C++ VS winhttp encapsulates a downloader


foreword

The directory of this series of tutorials: C++ tutorial directory

It is generally troublesome to download something online with C++, and most people will choose to use third-party libraries.

But in fact, the windows platform has actually provided our related api functions, which can be used directly in VS without installing third-party libraries written by others, but it is more troublesome to use.

So in order to simplify the use, this article will briefly introduce some methods of using these APIs, and encapsulate them into a class, which can be directly copied into your code for use.

1. Principle

To use something, sometimes it is necessary to understand the principle, because the source code provided may not be perfect and cannot meet your actual requirements. At this time, you generally need to improve it according to your own needs.

The first thing we need to know is that all the web pages you can see are basically built based on HTTPthese HTTPStwo protocols.

And these two protocols, if you read another article in this column: C++

Guess you like

Origin blog.csdn.net/weixin_50964512/article/details/131287738