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.

190 questions
15
votes
6 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
  • 442
  • 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
  • 326
  • 3
  • 7
  • 23
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,583
  • 4
  • 35
  • 50
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
10
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,203
  • 3
  • 36
  • 55
10
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
  • 339
  • 1
  • 4
  • 17
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,251
  • 6
  • 31
  • 48
8
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
  • 183
  • 1
  • 2
  • 7
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
  • 28,205
  • 28
  • 128
  • 277
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
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,761
  • 1
  • 24
  • 43
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,445
  • 3
  • 23
  • 34
6
votes
3 answers

Reading JSON from a file using C++ REST SDK (Casablanca)

I have the following code which should read the contents of a text file and parse it as JSON try { string_t importFile = argv[++iArgCounter]; // extract filename ifstream_t …
Paul S Chapman
  • 832
  • 10
  • 37
6
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…
1
2 3
12 13