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.

25 lines
578B

  1. #pragma once
  2. #include <string>
  3. #include <jansson.h>
  4. namespace rack {
  5. enum RequestMethod {
  6. METHOD_GET,
  7. METHOD_POST,
  8. METHOD_PUT,
  9. METHOD_DELETE,
  10. };
  11. /** Requests a JSON API URL over HTTP(S), using the data as the query (GET) or the body (POST, etc) */
  12. json_t *requestJson(RequestMethod method, std::string url, json_t *dataJ);
  13. /** Returns the filename, blank if unsuccessful */
  14. bool requestDownload(std::string url, std::string filename, float *progress);
  15. std::string requestEscape(std::string s);
  16. std::string requestSHA256File(std::string filename);
  17. } // namespace rack