-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp.h
More file actions
71 lines (65 loc) · 2.65 KB
/
http.h
File metadata and controls
71 lines (65 loc) · 2.65 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _TEAM11_HTTP_H
#define _TEAM11_HTTP_h
#include "FreeRTOS.h"
#include "queue.h"
#include "stdio.h"
#include <string.h>
#include <stdbool.h>
#include "debug_communication.h"
#include "crc32.h"
/*
* Functions for ending HTTP messages. Should not be used directly by tasks.
*/
/*
* Create a new object in the database. A HTTP response
* with the ID of the object will be sent.
* @param collection A null terminated string with the table name.
* @param body A buffer of bytes representing a JSON payload.
* @param size The size of the body buffer.
* @param sequence_number The sequence number. The response will include it in
* its body.
*/
void http_generic(char * action, char * collection, char * body, int sequence_number);
/*
* Create a object that matches all the fields in the body.
* A HTTP response with the object will be sent.
* @param collection A null terminated string with the table name.
* @param body A buffer of bytes representing a JSON payload.
* @param size The size of the body buffer.
* @param sequence_number The sequence number. The response will include it in
* its body.
*/
void http_post(char * collection, char * body, int sequence_number);
/*
* Return an object that matches all the fields in the body.
* A HTTP response with the object will be sent.
* @param collection A null terminated string with the table name.
* @param body A buffer of bytes representing a JSON payload.
* @param size The size of the body buffer.
* @param sequence_number The sequence number. The response will include it in
* its body.
*/
void http_get(char * collection, char * body, int sequence_number);
/*
* Delete an object from the database. A HTTP response
* confirming the deletion will be returned.
* @param collection A null terminated string with the table name.
* @param body A buffer of bytes representing a JSON payload.
* @param size The size of the body buffer.
* @param sequence_number The sequence number. The response will include it in
* its body.
*/
void http_delete(char * collection, char * body, int sequence_number);
/*
* Update an object in database. A HTTP response
* confirming the update will be returned.
* @param collection A null terminated string with the table name.
* @param body A buffer of bytes representing a JSON payload.
* @param query A buffer of bytes representing a JSON payload.
* @param size The size of the body buffer.
* @param sequence_number The sequence number. The response will include it in
* its body.
*/
void http_update_generic(char * action, char * collection, char * body, char * query, int sequence_number);
void http_update(char * collectoin, char * body, char * query, int sequence_number);
#endif