c++ - 使用 C++ 的 HTTP 请求
问题描述
我需要向服务器 (www.google.com) 发送 HTTP 请求并获得响应。所有这些我都是用 C++ 实现的,我需要一个最小尺寸的库。我尝试在 Visual Studio 中连接 curl、cpr,但没有成功。PS我是C ++的新手。谢谢大家 :D
解决方案
我如何在 VS 中安装 curl
我建议你可以尝试使用 vcpkg 来安装 curl:
1,从: https ://github.com/microsoft/vcpkg/archive/2019.08.zip获取 vcpkg并将其解压缩到您选择的文件夹(例如C:\vcpkg\
)
2、打开VS 2017的开发者命令提示符(见Windows开始菜单或%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools\
),cd
然后C:\vcpkg\
3、运行bootstrap-vcpkg.bat
4、运行vcpkg.exe integrate install
5、运行vcpkg.exe install curl
6,然后你可以尝试使用。
更多详情,我建议你可以参考链接: https ://stackoverflow.com/a/54680718/11872808
推荐阅读
- python - 带有嵌套序列化程序的 Django 视图
- lisp - Lisp/列表的交集
- jenkins - 在 Jenkinsfile 中使用 @grab
- kotlin - 数组列表
添加扩展 AbstractObject 的对象是不可能的。如何解决? - bluetooth - [RPi3][Bluez] 已成功连接到 BLE 设备,但无法列出 GATT 属性
- sql - 在页面的 html 中显示/嵌入代表来自 db 的每个用户的 user_id 是否安全?
- java - JavaFx 调用目标异常
- php - php无法识别其他方法中的pdo对象
- c# - ASP.Net Core 从构造函数返回结果
- ember.js - 是否可以在 Ember 中将 Torii 与 FastBoot 一起使用?