-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (21 loc) · 830 Bytes
/
main.cpp
File metadata and controls
26 lines (21 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "RiftHTTP.h"
#include <iostream>
int main() {
Rift::RiftHTTP httpClient;
// Settings for DELETE request
Rift::HttpMethod method = Rift::HttpMethod::DEL;
std::string url = "https://jsonplaceholder.typicode.com/posts/1";
std::map<std::string, std::string> headers;
std::map<std::string, std::string> params;
std::string body = "";
Rift::HttpResponse response;
// Send the request
if (httpClient.SendHTTPRequest(method, url, headers, params, body, response)) {
std::cout << "DELETE Request Status Code: " << response.statusCode << std::endl;
std::cout << "DELETE Request Response: " << response.body << std::endl;
}
else {
std::cerr << "DELETE request failed: " << response.errorMessage << std::endl;
}
return 0;
}