Category : rest

A request uploading a CSV file using cURL: curl –location –request PUT ‘http://localhost/store/apples/upload/’ –header ‘Accept: application/json’ –form ‘[email protected]"/home/user/Downloads/apples.csv"’ I am trying to implement a C++ function using C++ Rest SDK that is functionally equivalent to the above request: void uploadCsvFile(const std::string& csv_file_path) const { web::uri_builder builder(U("http://localhost/store/apples/upload/")); http_client client(builder.to_string()); http_request req; req.set_method(methods::PUT); req.headers().add("Accept", "application/json"); // TODO: ..

Read more

I’m trying to create a REST service on a Windows 10 PC using Python 3.9. My code responds appropriately when I make a request to localhost:5000 or 127.0.0.1:5000. The LAN address is 192.168.1.36 (Static), and if I ping that address I get a good response. I’ve created firewall rules for both inbound and outbound traffic ..

Read more

I’m using drogon with main function like this #include <memory> using namespace drogon; int main() { app().setLogPath("./") .setLogLevel(trantor::Logger::kWarn) .addListener("0.0.0.0", 8080) .setThreadNum(4) .enableGzip(false) ; app().run(); } I have one controller class that allocates resources in constructor (like memory, handles etc.). There are 4 threads for whole service (configured above in main). Is there a possibility that ..

Read more

Below is the Description and C# code, //path is path of the file Var Client new RestClient("http://localhost:56781/api/FileUpload/UploadFile"); Var request = new RestRequest(Method.POST); request.AddFile()"xmlFile", path); Currenntly I have Integrated cpr Library for rest client in C++ , where in I was able to create rest client and parameters, but where can i add xml file generated? ..

Read more