-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.hpp
More file actions
51 lines (42 loc) · 1.72 KB
/
Copy pathrequests.hpp
File metadata and controls
51 lines (42 loc) · 1.72 KB
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
41
42
43
44
45
46
47
48
49
50
51
#ifndef _REQUESTS_
#define _REQUESTS_
#include "client_lib.hpp"
/// @brief Computes a GET request where are added all the cookies and JWT
/// @param host Host address
/// @param url Where to send it
/// @param cookies Cookies map
/// @param jwt JWT or NULL
/// @return Char* to request
char *compute_get_request(const char *host, const char *url, unordered_map<string, string> cookies, char *jwt);
/// @brief Computes a POST request
/// @param host Host address
/// @param url Where to send it
/// @param content_type JSON for jsons
/// @param body_data Payload
/// @param body_len Payload length
/// @param cookies Cookies map
/// @param jwt JWT or NULL
/// @return Char* to request
char *compute_post_request(const char *host, const char *url, const char *content_type, const char *body_data,
int body_len, unordered_map<string, string> cookies, char *jwt);
/// @brief Computes a PUT request
/// @param host Host address
/// @param url where to send it
/// @param content_type JSON for jsons
/// @param body_data Payload for updating fields
/// @param body_len Payload length
/// @param cookies Cookies map
/// @param jwt JWT or NULL
/// @return Char* to request
char *compute_put_request(const char *host, const char *url, const char* content_type, const char *body_data,
int body_len, unordered_map<string, string> cookies, char *jwt);
/// @brief Computes a DELETE request
/// @param host Host address
/// @param url Where to send it
/// @param cookies Cookies map
/// @param jwt JWT or NULL
/// @param body Payload or NULL
/// @return Char* to request
char *compute_delete_request(const char *host, const char *url, unordered_map<string, string> cookies,
char *jwt, char *body);
#endif