SatDump 2.0.0-alpha-76a915210
|
HTTP Get/Post functions and others. More...
#include <string>
Go to the source code of this file.
Functions | |
size_t | satdump::curl_write_std_string (void *contents, size_t size, size_t nmemb, std::string *s) |
cURL helper function, writing the payload into a std::string | |
int | satdump::perform_http_request (std::string url, std::string &result, std::string added_header="", float *progress=nullptr) |
Perform a HTTP Request on the provided URL and return the result as a string. | |
int | satdump::perform_http_request_post (std::string url_str, std::string &result, std::string post_req, std::string added_header="") |
Perform a HTTP Request on the provided URL and return the result as a string, with POST data. |
HTTP Get/Post functions and others.
size_t satdump::curl_write_std_string | ( | void * | contents, |
size_t | size, | ||
size_t | nmemb, | ||
std::string * | s ) |
cURL helper function, writing the payload into a std::string
Provided a std::string is passed as userdata for Curl, this can be used a handler to write incoming data into said string.
int satdump::perform_http_request | ( | std::string | url, |
std::string & | result, | ||
std::string | added_header = "", | ||
float * | progress = nullptr ) |
Perform a HTTP Request on the provided URL and return the result as a string.
url_str | URL to use |
result | HTTP response, as a string |
added_header | optional additional headers |
progress | optional progress float pointer |
int satdump::perform_http_request_post | ( | std::string | url_str, |
std::string & | result, | ||
std::string | post_req, | ||
std::string | added_header = "" ) |
Perform a HTTP Request on the provided URL and return the result as a string, with POST data.
url_str | URL to use |
result | HTTP response, as a string |
post_req | POST payload |
added_header | optional additional headers |