https://github.com/thecompez/restservice
RestService is a modern cross-platform RESTful library!
https://github.com/thecompez/restservice
cpp20 curl json network restful-api restful-webservices webservices
Last synced: 5 months ago
JSON representation
RestService is a modern cross-platform RESTful library!
- Host: GitHub
- URL: https://github.com/thecompez/restservice
- Owner: TheCompez
- License: mit
- Created: 2020-10-31T16:00:57.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-07T15:27:21.000Z (over 4 years ago)
- Last Synced: 2024-11-19T20:53:04.088Z (about 1 year ago)
- Topics: cpp20, curl, json, network, restful-api, restful-webservices, webservices
- Language: C++
- Homepage:
- Size: 220 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## RestService is a modern cross-platform RESTful library ##
**Note :** This library is not yet complete and conceptually under development.
[](https://forthebadge.com)
[](https://lgtm.com/projects/g/Kambiz-Asadzadeh/RestService/alerts/)
[](https://lgtm.com/projects/g/Kambiz-Asadzadeh/RestService/context:cpp)




## Installation
First of all, You need to make sure that curl library is installed on your development environment. So it may have some problems!
## Building
- You need CMake tool for building source code
- Get Curl & RapidJson [Pay Attention: RapidJson is header only]
- All source code is written with Pure STL 1z (C++17)
- MSVC 2017, GCC8.x or Clang 9.x
- Add RestService.dll [on Windows], libRestService.dylib [on macOS] or libRestService.so [on Linux] for your project as external library. you can compile it by static mode.
- Import SDK common header ```#include ```
**Note:** In order to build the create, your compiler must support C++17 features.
**Building extra option in CMake**
```
cmake .. -DENABLE_SAFE_ONLY=true
cmake .. -DENABLE_SAFTY_MODE=true
```
## Usage Example
```cpp
#include
#include
int main()
{
auto request = RestService::NetworkRequest();
//!GET Method
{
request.get("http://dummy.restapiexample.com/api/v1/employees");
auto result = request.getResult();
std::cout << "Result Get: " << result << std::endl;
}
//!POST Method
{
request.post("https://jsonplaceholder.typicode.com/comments?", "postId=1");
auto result = request.getResult();
std::cout << "Result Post : " << result << std::endl;
}
return 0;
}
```
## Contribution
Bug fixes, docs, and enhancements welcome! Please let me know kambiz.ceo@gmail.com
## **ToDo**
* More Exception handling.
* Add Logger for any states.
* And more features...