3#if defined( __EMSCRIPTEN__ ) || !defined( MRMESH_NO_CPR )
6#include "MRPch/MRJson.h"
7#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 );
89 Method method_{ Method::Get };
93 int timeout_{ 10000 };
94 std::unordered_map<std::string, std::string> params_;
95 std::unordered_map<std::string, std::string> headers_;
96 std::string inputPath_;
97 std::vector<FormData> formData_;
99 std::string outputPath_;
Definition MRWebRequest.h:18
MRVIEWER_API void setOutputPath(std::string outputPath)
MRVIEWER_API void setAsync(bool async)
MRVIEWER_API void send(ResponseCallback callback)
MRVIEWER_API void clear()
std::function< void(const Json::Value &response)> ResponseCallback
Definition MRWebRequest.h:79
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:24
MRVIEWER_API void setHeaders(std::unordered_map< std::string, std::string > headers)
MRVIEWER_API void setLogName(std::string logName)
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:576
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:58
MRVIEWER_API Expected< Json::Value > parseResponse(const Json::Value &response)