-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
40 lines (30 loc) · 1.01 KB
/
main.cpp
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
#include "HttpRequest.h"
using namespace httpTypes;
int main()
{
std::cout << "App launched!" << std::endl;
// Create an http request object
std::unique_ptr<HttpRequest> request2(new HttpRequest("http://www.ele-dev.de/drone/pushStats.php", REQUEST_METHOD::HTTP_GET));
// Add payload (GET/POST parameters)
std::string pitchParam, rollParam, yawParam;
std::cout << "\nType in values for the GET parameters: " << std::endl;
std::cout << " pitch = ";
std::cin >> pitchParam;
std::cout << "\n roll = ";
std::cin >> rollParam;
std::cout << "\n yaw = ";
std::cin >> yawParam;
std::cout << std::endl;
request2->addParameter("pitch", pitchParam);
request2->addParameter("roll", rollParam);
request2->addParameter("yaw", yawParam);
// Send the request
request2->sendRequest();
// Output the answer from the webserver
std::cout << std::endl;
std::cout << "HTTP Response text: " << std::endl;
std::cout << request2->getResponse().text << std::endl;
std::cin.get();
return EXIT_SUCCESS;
}