MeshLib C++ Docs
Loading...
Searching...
No Matches

this class is needed to unify cpp and wasm requests More...

#include <MRViewer/MRWebRequest.h>

Classes

struct  FormData
 set payload in multipart/form-data format More...

Public Types

enum class  Method {
  Method::Get , Method::Post , Method::Patch , Method::Put ,
  Method::Delete
}
using ResponseCallback = MR::WebResponseCallback

Public Member Functions

 WebRequest ()=default
 WebRequest (std::string url)
void clear ()
 clear all request data
void setMethod (Method method)
 set HTTP method
void setTimeout (int timeoutMs)
 set timeout in milliseconds
void setParameters (std::unordered_map< std::string, std::string > parameters)
 set URL query parameters
void setHeaders (std::unordered_map< std::string, std::string > headers)
 set HTTP headers
void setInputPath (std::filesystem::path inputPath)
 set path to the file to upload
void setUploadProgressCallback (ProgressCallback callback)
void setFormData (std::vector< FormData > formData)
void setBody (std::string body)
 set payload in plain format
void setOutputPath (std::filesystem::path outputPath)
 prefer to save the response to file
void setDownloadProgressCallback (ProgressCallback callback)
 set progress callback for download
void setAsync (bool async)
 set async mode (return immediately after sending request)
void setLogName (std::string logName)
 set log name
void send (std::string url, std::string logName, ResponseCallback callback, bool async=true)
void send (ResponseCallback callback)

Static Public Member Functions

static void waitRemainingAsync ()
 if any async request is still in progress, wait for it

Detailed Description

this class is needed to unify cpp and wasm requests


The documentation for this class was generated from the following file: