|
Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
|
#include "http.h"Functions | |
| CURLcode | HttpRequest (cJSON **response, const char *URL, struct curl_slist *headers, int8_t post, const char *body) |
| HTTP GET & POST request using cURL. More... | |
| CURLcode HttpRequest | ( | cJSON ** | response, |
| const char * | URL, | ||
| struct curl_slist * | headers, | ||
| int8_t | post, | ||
| const char * | body | ||
| ) |
HTTP GET & POST request using cURL.
Basic HTTP request using CURL.
Most initialisation is done outside of this function. This function just handles the HTTP request and puts the data inside a provided cJSON object. Note this function has a memory leak on a Mac M1 -> (curl_easy_perform()) has 13 leaks, totalling 496 bytes per call.
| response | The cJSON response to populate with JSON. |
| URL | The request URL. |
| headers | Headers to include in request. |
| post | Interger flag to request POST request (set to 1). |
| body | POST request body. |