简体   繁体   English

如何使用C ++语言的Web API?

[英]How to use Web API's with C++ language?

So i've been learning OOP is quite a while now and wanted to test out the little knowledge i have.. I wanted to use some API provided by the website, This API Checks if a username is already been taken. 所以我一直在学习OOP已经有一段时间了,想要测试我所拥有的一点点知识。我想使用网站提供的一些API,这个API检查是否已经使用了用户名。 But how will i do it with C++? 但是我如何用C ++做到这一点? Where will i start? 我将从哪里开始?

This is : 这是 :

http://www.roblox.com/UserCheck/DoesUsernameExist?username=bob1 http://www.roblox.com/UserCheck/DoesUsernameExist?username=bob1

The username is taken so: 用户名是这样的:

{
    "success" :true
}

C++ from a box does not provide a support of HTTP protocol and a JSON parser. 来自框的C ++不提供HTTP协议和JSON解析器的支持。 You should use third party libraries such as libcurl and libjson . 您应该使用第三方库,例如libcurllibjson

Here is an example, how to use libcurl to download a JSON data. 是一个例子,如何使用libcurl下载JSON数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM