3#if defined( __EMSCRIPTEN__ ) || !defined( MRMESH_NO_CPR )
6#include <unordered_map>
41 MRVIEWER_API
void setParameters( std::unordered_map<std::string, std::string> parameters );
44 MRVIEWER_API
void setHeaders( std::unordered_map<std::string, std::string> headers );
61 MRVIEWER_API
void setFormData( std::vector<FormData> formData );
64 MRVIEWER_API
void setBody( std::string body );
84 MRVIEWER_API
void send( std::string url, std::string logName,
ResponseCallback callback,
bool async =
true );
91 Method method_{ Method::Get };
95 int timeout_{ 10000 };
96 std::unordered_map<std::string, std::string> params_;
97 std::unordered_map<std::string, std::string> headers_;
98 std::string inputPath_;
99 std::vector<FormData> formData_;
101 std::string outputPath_;
Definition MRWebRequest.h:17
MRVIEWER_API void setOutputPath(std::string outputPath)
MRVIEWER_API void setAsync(bool async)
MRVIEWER_API void send(ResponseCallback callback)
MRVIEWER_API void clear()
MR::WebResponseCallback ResponseCallback
Definition MRWebRequest.h:78
MRVIEWER_API void setFormData(std::vector< FormData > formData)
MRVIEWER_API void setBody(std::string body)
MRVIEWER_API void setInputPath(std::string inputPath)
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:23
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 MRMesh/MRMeshFwd.h:729
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:25
std::function< void(const Json::Value &response)> WebResponseCallback
Definition MRWebResponseCallback.h:9
MRVIEWER_API Expected< Json::Value > parseResponse(const Json::Value &response)