3#if defined( __EMSCRIPTEN__ ) || !defined( MRMESH_NO_CPR )
6#include <unordered_map>
42 MRVIEWER_API
void setParameters( std::unordered_map<std::string, std::string> parameters );
45 MRVIEWER_API
void setHeaders( std::unordered_map<std::string, std::string> headers );
62 MRVIEWER_API
void setFormData( std::vector<FormData> formData );
65 MRVIEWER_API
void setBody( std::string body );
85 MRVIEWER_API
void send( std::string url, std::string logName,
ResponseCallback callback,
bool async =
true );
92 Method method_{ Method::Get };
96 int timeout_{ 10000 };
97 std::unordered_map<std::string, std::string> params_;
98 std::unordered_map<std::string, std::string> headers_;
99 std::filesystem::path inputPath_;
100 std::vector<FormData> formData_;
102 std::filesystem::path outputPath_;
Definition MRWebRequest.h:18
MRVIEWER_API void setAsync(bool async)
MRVIEWER_API void send(ResponseCallback callback)
MRVIEWER_API void clear()
MR::WebResponseCallback ResponseCallback
Definition MRWebRequest.h:79
MRVIEWER_API void setFormData(std::vector< FormData > formData)
MRVIEWER_API void setOutputPath(std::filesystem::path outputPath)
MRVIEWER_API void setInputPath(std::filesystem::path inputPath)
MRVIEWER_API void setBody(std::string body)
MRVIEWER_API void setUploadProgressCallback(ProgressCallback callback)
MRVIEWER_API WebRequest(std::string url)
MRVIEWER_API void send(std::string url, std::string logName, ResponseCallback callback, bool async=true)
MRVIEWER_API void setMethod(Method method)
Method
Definition MRWebRequest.h:24
MRVIEWER_API void setHeaders(std::unordered_map< std::string, std::string > headers)
MRVIEWER_API void setLogName(std::string logName)
static MRVIEWER_API void waitRemainingAsync()
if any async request is still in progress, wait for it
MRVIEWER_API void setDownloadProgressCallback(ProgressCallback callback)
MRVIEWER_API void setParameters(std::unordered_map< std::string, std::string > parameters)
MRVIEWER_API void setTimeout(int timeoutMs)
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:742
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:28
std::function< void(const Json::Value &response)> WebResponseCallback
Definition MRWebResponseCallback.h:9
MRVIEWER_API Expected< Json::Value > parseResponse(const Json::Value &response)