You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
443B

  1. #pragma once
  2. #include <string>
  3. #include <jansson.h>
  4. enum RequestMethod {
  5. GET_METHOD,
  6. POST_METHOD,
  7. PUT_METHOD,
  8. DELETE_METHOD,
  9. };
  10. /** Requests a JSON API URL over HTTP(S), using the data as the query (GET) or the body (POST, etc) */
  11. json_t *requestJson(RequestMethod method, std::string url, json_t *dataJ);
  12. /** Returns the filename, blank if unsuccessful */
  13. bool requestDownload(std::string url, std::string filename, float *progress);