Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/greathqy/Cocos2d-x-Asynchronous-Http-Request-Library
A simple library wrote as a cocos2d-x extension that provides asynchronously http get/post/download request facility.
https://github.com/greathqy/Cocos2d-x-Asynchronous-Http-Request-Library
Last synced: 18 days ago
JSON representation
A simple library wrote as a cocos2d-x extension that provides asynchronously http get/post/download request facility.
- Host: GitHub
- URL: https://github.com/greathqy/Cocos2d-x-Asynchronous-Http-Request-Library
- Owner: greathqy
- License: mit
- Created: 2012-07-31T14:21:10.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-02T13:27:10.000Z (over 12 years ago)
- Last Synced: 2024-07-31T22:53:56.076Z (3 months ago)
- Language: C++
- Size: 4.1 MB
- Stars: 59
- Watchers: 17
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
A Cocos2d-x Asynchronous Http Request Libray That Let You Make Asynchrounous Http Requests From Cocos2d-x A FUN!
==================You can find the library file:
* CCHttpRequest.h
* CCHttpRequest.cppUnder CCHttpRequestExample/Classes
This library had been written as a cocos2d-x extension, Use it is very simple:
CCHttpRequest *gateway = CCHttpRequest::sharedHttpRequest();
//Get Request
std::string url = "http://www.baidu.com";
gateway->addGetTask(url, NULL, NULL);//Post Request
std::string postData = "key=value";
gateway->addPostTask(url, postData, NULL, NULL);//Download File
std::vector downloads;
downloads.push_back("http://www.baidu.com/index.php");
gateway->addDownloadTask(urls, NULL, NULL);You can specify a callback just by simply replace the NULL parameter with your selector, So you can process the response data in your callback method.