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
10
votes
2 answers

Function that returns map in c++

Can someone please give an actual example of function that returns map in c++. I tried answers from other posts but I don't know how to apply in my case. This is my working code: auto DataArray = jvalue.at(U("data")).as_array(); //Make an…
noyruto88
  • 767
  • 2
  • 18
  • 40
10
votes
1 answer

How do I use swagger-codegen cpprest client library code?

I've recently used swagger-codegen to generate the cpprest client code for my swagger spec. The code all compiles and links swell in my C++ app. But, how do I actually use it from my C++ application? I've seem to have initialized the ApiClient and…
Jay Koutavas
  • 989
  • 1
  • 14
  • 28
8
votes
3 answers

Statically linking Casablanca/CPPREST SDK

I am trying to create a Windows-based VC++ DLL (in VS 2015) that statically links to the Casablanca CPPREST SDK. That is, I would like a single DLL output which contains the CPP REST library along with my code. I have referred to this thread,…
Simple Guy
  • 568
  • 5
  • 21
7
votes
2 answers

CPPRestSDK (casablanca) Extract JSON From Incoming WebSocket Messages (malformed token)

I'm connecting to a WebSocket whom always replies in JSON. I see there is an extract_string method for websocket_incoming_message however after trying numerous things with json:value it seems as though you can only construct JSON arrays on-the-fly…
KKlouzal
  • 732
  • 9
  • 32
4
votes
1 answer

What's wrong with the cpprestsdk https handshake

I applied ssl but the result is not satisfactory. There is no key change between the server and the client when viewed with wireshark. Communication is possible, but not satisfactory. The server is Linux and the client is using Chrome. I know that…
Hwan E
  • 566
  • 2
  • 13
4
votes
2 answers

CppRestSDK How to POST multipart data

I'm trying to POST Multipart data to a server, I'm switching to CPPRestSDK from CPR, but I can't seem to find any documentation on it Coming from CPR, https://github.com/whoshuu/cpr Meaning I've tried that code, but I just can't seem to find any…
JohnkaS
  • 622
  • 8
  • 18
4
votes
0 answers

C++ using CPPRestSDK ("Casablanca") to authenticate to azure IoT Hub

EDIT: I managed to get a c# version working (below) Original Question: I'm trying to connect to Azure's IoT Hub through the cpprestsdk and POST a json-structured obj to it. However, i cant find anything regarding authentication anywhere. I've…
Joel
  • 5,732
  • 4
  • 37
  • 65
4
votes
3 answers

Mutex is not supported when compiling with /clr or clr:pure (cpprestsdk aka casablanca)

I create a CLR project in visual c++ with 64 bit configuration, and try to use cpprestsdk aka casablanca 64bit. But when I run the project, an error occured: 1>------ Build started: Project: Timestamp, Configuration: Debug x64…
noyruto88
  • 767
  • 2
  • 18
  • 40
4
votes
0 answers

How to add cpp rest sdk (cassablanca) to a project in VSCode on Mac

I am trying to install and add cpprestsdk to my c++ project and I cannot seem to figure out how to do so. I have followed the instructions here: https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Mac-OS-X that have me build and run test…
Biggytiny
  • 519
  • 10
  • 29
4
votes
1 answer

Convert string to web::json using cpprestsdk

I have a c++ application in Visual C++ 2013 that uses cpprestsdk to get info from server. It is working fine (an example here) Now, I am using an external third party API and this API has a method that return an string as…
Jafuentes
  • 365
  • 2
  • 6
  • 13
4
votes
1 answer

Convert std::vector to JSON using CPPREST-SDK

At the moment I am working on a c++ project, writing the server side of an API using the CPPRESTSDK (a.k.a. Casablanca). Serializing values such as int, double etc. is already implemented in the cpprestsdk library. I wanted to ask now, if there is…
Jahgringo
  • 41
  • 1
  • 2
4
votes
1 answer

Get IP of HTTP request in Casablanca

I have a small server that listens to http requests using Casablanca / cpprestsdk. I've seen that other APIs provide this feature of retrieving client's IP, but after foraging the Internet and the sdk, well.. here I am. Any help plz?
kundrata
  • 651
  • 3
  • 12
  • 24
3
votes
0 answers

Client-server authentication using certificates - C++

I'm very new to authentication. I have been trying to read stuff for the past week or so, but it's all pretty overwhelming. I have a client in C++ and server in .NET. Client communicates with server using REST (cpprestsdk). As of today, this is how…
3
votes
1 answer

dll library with cpprestsdk compilation on windows xp

I have dll project using cpprestsdk in visual studio 2019 (along with console application for testing purposes). On windows 7 and windows 10 original package works as expected, however I'm having hard time to compile and run on windows…
3
votes
1 answer

Error LNK2001: unresolved external symbol web::websockets::client::websocket_callback_client

I'm attempting to use cpprestsdk, to establish a simple websocket connection: #include using namespace web; using namespace web::websockets::client; int main(int argc, char* argv[]) { websocket_callback_client client; …
George Barlow
  • 155
  • 1
  • 5
1
2 3
13 14