Questions tagged [cpprest-sdk]

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design.

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design.

https://github.com/Microsoft/cpprestsdk

206 questions
1
vote
0 answers

How to POST using cpprest-sdk without using any json data

I'm new to the REST API world and to the cpprest-sdk. I have a curl call that I want to convert to a program using cpprest-sdk. Here is my curl call: curl -X POST "https://my.url/api/v1/APIKey/GetToken" -H "accept: */*" -H "X-API-KEY:…
StarFrost
  • 11
  • 1
1
vote
0 answers

cpprest-sdk: get the certificate to an open connection from within a HTTP listener and/or request handler (Linux)

With a colleague, I'm working on a service (currently implemented as a listener with a number of request handlers in cpprest-sdk on Linux) that needs to make certain additional checks (i.e. allow only a subset of certificates) for the certificate of…
Hes
  • 9
  • 3
1
vote
1 answer

C++ I don't know what it means to use "this" and "std::placeholders::_1" when using the callback function

I am trying to make a server by looking at the sample code of cpprestSDK. But I don't know why I bind in the sample code. Below is the sample code. stdafx.h class Handler{ public: Handler() {}; Handler(utility::string_t url); …
Hwan E
  • 566
  • 2
  • 13
1
vote
0 answers

cpprestsdk server POST read failure

I sent a json POST with curl, but I can't read it from the server. What is the problem? void Handler::handle_post(http_request request){ std::cout << request.to_string() << std::endl; auto j = json::value::object(); …
Hwan E
  • 566
  • 2
  • 13
1
vote
1 answer

Microsoft C++ Rest SDK for Graph APIs

I am trying out Microsoft's C++ Rest SDK (https://microsoft.github.io/cpprestsdk/index.html) to invoke Graph APIs but it has been a struggle so far. In C# I can complete my tasks in a few lines of code. For example, refer following code from a…
user13260866
  • 131
  • 1
  • 2
  • 9
1
vote
1 answer

Write a cpprestsdk json value object into a file

I receive a JSON response body as part of a REST request. I would like to write the body of the JSON into a file. A quick way to do this would be to use the web::http::response object itself.. pplx::task requestTask =…
user1173240
  • 1,455
  • 2
  • 23
  • 50
1
vote
0 answers

How to use SignalR C++ client library with emscripten?

There are no problems with SignalR itself, but it are based on CPPRest. CPPRest is based on Boost-asio. Boost-asio needs OpenSSL libraries. For Boost-asio I can not use Boost libraries, if I build several cpp. And at Visual Studio it works well. But…
1
vote
1 answer

How to deal with non-ASCII UTF-8 characters across my application stack

I'm storing country names in a sqlite database exposed via a cpprest server. These country names are being queried by my web application, and the results returned by the server are raw binary strings (octet streams) that have the name length and the…
Walter
  • 664
  • 1
  • 6
  • 19
1
vote
0 answers

issue with converting string to unsigned char pointer in c++ windows using cpprestsdk

I am getting image data from POST API using cpprestsdk in form of vector and then I am trying to convert it into unsigned char pointer for further processing. Below is my code and it is working properly in ubuntu but in windows, the data is getting…
Harsh Shah
  • 11
  • 1
1
vote
0 answers

Is there a way to direct swagger codegen to generate task based continuations for tasks to catch exception thrown by cpprest?

I have swagger codegen generated c++ code with cpprest that makes some server calls. Issue that I am facing: If cpprest http request returns any error code (4xx or 5xx), I get the following crash when I run my program in CentOS Linux. If cpprest…
Swtsvn
  • 307
  • 1
  • 3
  • 12
1
vote
0 answers

heap corruption exception when using cpprestsdk

I'm trying to use the http_listener in a larger MFC project of mine built in visual studio 2017 with platform toolset v141. The project statically links to other MFC based libraries that were built using v141_xp platform toolset. It runs fine until…
Alex
  • 712
  • 2
  • 13
  • 27
1
vote
0 answers

cpprestsdk request blocked and response with "Failed to read HTTP status line" in a multi-threaded situation

I have created a client server system server by following the CppRestSdk examples. Here is the sample code section of my implementation (only the request sending section). nf.request(methods::POST, U("/"), requestBody) .then([=]…
Debashish
  • 1,155
  • 19
  • 34
1
vote
2 answers

how to convert utf8 to std::string?

I am working on this code which receives a cpprest sdk response containing a base64_encoded payload which is a json. here is my code snippet: typedef std::wstring string_t; //defined in basic_types.h in cpprest lib void demo() { …
Soby
  • 46
  • 1
  • 6
1
vote
1 answer

How to close C++ REST Sdk websocket?

I'm using cpprestsdk on the client and .net core 2.1 on the server side. Everything works except the closing part. // C++ web::websockets::client::websocket_callback_client _client; //connecting and working with…
sibvic
  • 1,622
  • 2
  • 12
  • 19
1
vote
0 answers

Errors while build cpprestsdk using gcc-8.2

When I try building cpprestsdk with a cross compiler gcc I've the following issue: cd /home/ubuntu/projects/cpprestsdk/Release/build_qamf-dev/src && /opt/qamf-dev/x86_64-qamf/bin/x86_64-qamf-linux-gnu-g++ -DCPPREST_EXCLUDE_BROTLI=1…
Elvis Dukaj
  • 7,142
  • 12
  • 43
  • 85