Questions tagged [casablanca]

Casablanca is a Microsoft incubation effort to support cloud-based client-server communication in native code using a modern asynchronous C++ API design.

Casablanca is a Microsoft incubation effort to support cloud-based client-server communication in native code using a modern asynchronous C++ API design. It is a project that starts exploring how to best support C++ developers who want to take advantage of the radical shift in software architecture that cloud computing represents.

193 questions
13
votes
5 answers

Create a json array in C++

So im trying to create a json Object in c++ dynamically. I want to add a timestamp and then an array with the data included. So thats what my json String would look like : { "timestep": "2160.00", "vehicles": [ { "id":…
Hannes
  • 422
  • 1
  • 6
  • 23
12
votes
1 answer

C++ REST SDK (Casablanca) web::json iteration

https://msdn.microsoft.com/library/jj950082.aspx has following code. void IterateJSONValue() { // Create a JSON object. json::value obj; obj[L"key1"] = json::value::boolean(false); obj[L"key2"] = json::value::number(44); …
daewonyoon
  • 327
  • 1
  • 5
  • 17
12
votes
1 answer

Set Basic HTTP Authentication in Casablanca

I'm trying to modify the Casablanca tutorial to include basic HTTP authentication to access the Prosper API: auto fileStream = std::make_shared(); // Open stream to output file. auto requestTask =…
GraphicsMuncher
  • 4,269
  • 3
  • 30
  • 48
10
votes
2 answers

Casablanca: Assembly error gcc 4.8.1 on linux centos

I am trying to build casablanca, like they say on their page. Because I have gcc-4.8.1 installed using CXX=gcc-4.8 is not ok, so I have removed it doing just: cmake .. -DCMAKE_BUILD_TYPE=Release It creates the files and when I do make I am getting…
thedarkside ofthemoon
  • 2,041
  • 4
  • 26
  • 44
9
votes
1 answer

add Access-Control-Allow-Origin on http_listener in C++ REST SDK

I am running an HTTP server with web::http::experimental::listener::http_listener from Microsoft C++ REST SDK 1.3.1 and try to write HTML&Javascript as a client to interact with the server. almost without surprise I got ... Cross-Origin Request…
rnd_nr_gen
  • 2,079
  • 3
  • 35
  • 48
8
votes
2 answers

Where to get mythical Microsoft msgtool for C++ serialization

while reading about actors on http://msdn.microsoft.com/en-us/devlabs/hh975426.aspx I noticed the part on serialization: Since serialization is critical to the correct function of a program and it is so easy to get wrong, the C++ Actors library…
NoSenseEtAl
  • 23,776
  • 22
  • 102
  • 222
7
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
  • 812
  • 1
  • 11
  • 25
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
  • 642
  • 5
  • 25
7
votes
1 answer

Http_client post request using C++ REST SDK (Casablanca)

I'm trying to perform a POST HTTP request using C++ REST SDK (Casablanca) library, but I'm not succeeding... Nor I can find any recent/working snippet. Can anybody help me? With my following code I obtain a runtime web::json::json_exception saying…
stkhou
  • 173
  • 2
  • 7
7
votes
2 answers

undefined reference to symbol '_ZN5boost6system15system_categoryEv' error

I'm new to c++ rest sdk Casablanca and using it in Codelite ide. Operating System : Arch Linux gcc version : 6.1.1 While building the code I get the following error in debug mode: /bin/sh -c '/usr/bin/make -j4 -e -f Makefile' ----------Building…
Anmol
  • 309
  • 1
  • 3
  • 15
7
votes
1 answer

C++ rest sdk POST form data json

Is it possible to post "form data" whith C++ rest SDK (Casablanca)? I have a given web service which looking for post data in "form data", not in the body. This is the C++ code: http_client client(L"http://localhost/posttest/jsontest.php"); //…
Máté Eke
  • 131
  • 1
  • 1
  • 7
6
votes
1 answer

How to parse an URI elegantly in Casablanca

How would one parse the URI of a request (server side) elegantly in C++? URI is defined as in the Casablanca Documentation as: protocol : // server [: port] / path ? query # fragment Lets say, i want the path (with all elements) as a list and the…
x29a
  • 1,633
  • 1
  • 21
  • 39
6
votes
3 answers

no suitable user-defined conversion from utility::string_t to std::string

I am using the casablanca C++ Rest library to make HTTP requests. The problem is that this gives a utility::string_t string as output and I can't quite find any way to convert this to a classic std::string. Any…
Kaj
  • 2,311
  • 2
  • 20
  • 33
5
votes
0 answers

C++ REST SDK (casablanca): How to get the address of the client connected to http_listener?

I have a small HTTP server written with Casablanca and I would like to get the IP address of the client that sent the request. I looked at the members of http_request and could not find it. web::http::experimental::listener::http_listener…
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
  • 3,791
  • 1
  • 25
  • 41
1
2 3
12 13