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
0
votes
1 answer

C++ Consume API REST with Casablanca and POST XML

The question is how to consume API REST that needs to POST content on body type XML and on headers parameters. I found only solutions with JSON. return pplx::create_task([] { json::value postData; postData[L"name"] =…
Frein
  • 45
  • 8
0
votes
0 answers

Why I'm receiving a SIGSEV after a C++RestSdk request

I have this basic http_request performing correctly. I receive the 200 OK status code and respective body correctly, for all the times I perform a request (I even tried to perform several requests before leaving the application). The problem is…
José Silva
  • 47
  • 1
  • 10
0
votes
1 answer

Methods::GET not found in C++ REST

I've built Casablanca and all other dependencies correctly in Ubuntu 16.04. But when I follow those C++ examples on this site, I found the program cannot find methods::GET member. It only shows methods, but no child member of it. What did I miss?…
E_learner
  • 3,512
  • 14
  • 57
  • 88
0
votes
2 answers

'http': a namespace with this name does not exist C++ rest SDK

I'm working on a project which is using C++ RESTAPI. Im follwing Casablanca tutorial. According to that tutorial I added Casablanca to my C++ console aplication project using NuGet package manager. I am using Visual Studio 2015 Enterprise Edition.…
0
votes
1 answer

Why can't assign a string variable to json::value object?

This initialization is possible and can make the json::value object with the value of "hello1" as follows. json::value v1 = json::value::string(U("hello1")); // ok But this initialization is not working. What is the reason for that? How to create a…
Nwn
  • 561
  • 2
  • 9
  • 33
0
votes
0 answers

Send parameters by using GET method in REST server

I have simple REST server GET method: public class PersonController : ApiController { // GET: api/Person public IEnumerable Get() { return new string[] { "value1", "value2" }; } ... } It…
vico
  • 17,051
  • 45
  • 159
  • 315
0
votes
1 answer

Running Casablanca program fails with 'openssl/conf.h' file not found on Mac OS

I am trying to setup a Http client and download some data using the example shown here. When I try to run the program, it fails saying "conf.h" is not found. $g++ -std=c++11 BingSearch.cpp In file included from BingSearch.cpp:1: In file included…
Anit
  • 345
  • 1
  • 5
  • 19
0
votes
1 answer

No object generated while building MS Casablanca library for c++

Trying to build Microsoft REST SDK. Got errorious output: 1>d:\lb\cpprestsdk\release\include\cpprest\json.h(1386): error C2220: warning treated as error - no 'object' file generated 1>d:\lb\cpprestsdk\release\include\cpprest\json.h(1386): warning…
vico
  • 17,051
  • 45
  • 159
  • 315
0
votes
1 answer

cpprestsdk (casablanca) json value to std::vector

I am using cpprestsdk in order to create http client. I need to convert web::json::value like this: web::json::value obj; obj[U("1")] = web::json::value(U("123")); obj[U("2")] = web::json::value(U("321")); to std::vector In order to…
definename
  • 193
  • 1
  • 12
0
votes
0 answers

how change uri that http_listener listen to it

I use http_listener of cpprest(casablanca) library as my server. after some request from client I want to change uri that this listener listen to it in handle_post of listener. In main.cpp I have this code: changeIpOrPort = 0; try { …
samane
  • 23
  • 5
0
votes
1 answer

Difference between web::json::value::parse and web::json::value::string in Casablanca C++ REST SDK

I have a piece of code that looks like this (obj is a web::json::value): try { obj[key_str] = web::json::value::parse(value_str); } catch (...) { obj[key_str] = web::json::value::string(value_str); } I am not able to find the difference…
Kajal
  • 581
  • 11
  • 24
0
votes
1 answer

Linker Errors with casablanca in VS2015 while trying to build a simple HTTP listener

As part of the learning process about Rest services, i am trying to build a simple HTTP listener using the Microsoft c++ REST sdk "casablanca". My aim initially is to test if it can receive a simple POST request pointed at localhost and save the…
0
votes
3 answers

C++: parsing JSON string, having keys not enclosed into double quotes

I've been using Casablanca Json C++ library (cpprest) successfully for some time. Its parser (web::json::value::parse()) works perfectly on valid JSON strings. Say this will be parsed correctly: { "key1": [["1", 0.4], ["0", 0.6]], …
Oleg Shirokikh
  • 3,447
  • 4
  • 33
  • 61
0
votes
0 answers

Problems using C++ REST with Windows Form and mixed managed code in VS2015

I'm attempting to use the C++ REST SDK. I'm using this example as my starting point. What has worked so far is creating a new Windows CLR application in VS2015, adding a new cpp file, installing cpprestsdk thru NuGet, pasting the tutorial code into…
Apneal
  • 483
  • 4
  • 6
0
votes
0 answers

How to return value for a handle_post function in C++ REST SDK?

listener.support(methods::POST, handle_post); In handle_post function: void handle_post(http_request request) { //process the request I receives,extract the value in the request } Now I need the function handle_post to pass the msg it…
firstaccount
  • 155
  • 2
  • 13