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
1
vote
2 answers

Copy and pasting .so file doesn't work with linker

I compiled and built the casablanca c++ rest library in my home directory where my absolute path to the necessary .so file was /home/dev/casablanca/Release/build.release/Binaries/libcpprest.so. What I wanted to do was to simply cp and past that .so…
Dr.Knowitall
  • 10,080
  • 23
  • 82
  • 133
1
vote
1 answer

How to wrap a C++11 callback?

I'm using Casablanca C++ Rest SDK for http connections. Here is a basic piece of code that makes a http request. Copied from Casablanca documentation: // Creates an HTTP request and prints the length of the response stream. pplx::task
Thanh-Nhon Nguyen
  • 3,402
  • 3
  • 28
  • 41
1
vote
0 answers

Casablanca webserver gives seemingly random error

I am using the Casablanca REST SDK to make a webservice. The webservice has the client pass JSON through the URL and processes it. However in some cases if I send JSON that contains an array, it will crash the service. The strange part is the…
Pottsiex5
  • 487
  • 2
  • 6
  • 19
1
vote
2 answers

C++: Not Understanding Object Destruction Rules

The following C++ code fragment makes use of Microsoft's C++ Rest SDK. I'm not understanding why the first fragment works and other's don't. I'm assuming the differences are due to object destruction and scoping rules. I'm looking for an explanation…
BSalita
  • 8,420
  • 10
  • 51
  • 68
1
vote
1 answer

How do I reference the CPP Rest SDK in a native app?

I've got Visual Studio 2013 installed, it appears to come with a CPP Rest Extension SDK. The documentation explains how I can reference it in a Store App, but I want to use it from a native app. The headers don't seem to be immediately available, is…
Scott Langham
  • 58,735
  • 39
  • 131
  • 204
0
votes
1 answer

Send async post http request using cpprest without waiting for response

My target is to send async http request using cpprest without waiting for response (it's for logging purposes I don't care if its failed and I don't want to wait). My "main thread" (it's not exactly main, it's specific thread that triggers this…
InUser
  • 1,138
  • 15
  • 22
0
votes
0 answers

How to parse std::list to json::value in casablanca?

I'm trying to parse std::list to json::value with casablanca1.2.0 with Visual Studio 2012 and send JSON request with REST service(POST) from C++ application to Java Application. REST service requires a request DTO like this. // java public class…
0
votes
1 answer

POST to return results in the same request as response body (cpp REST POST SDK)

To explain the context of my problem. My application interface to a Manufacturing execution systems (MES) via a Flask server. I use Postman for debugging my work. I have an example that listen to the MES, when the MES sends (POST) my application an…
bhamadicharef
  • 360
  • 1
  • 11
0
votes
1 answer

cpprestsdk fails parsing with backslash

wstring str1 = L"\"address\":\"test \ 00001\",\"type\":\"Float\"" wstring str2 = L"\"address\":\"test \\ 00001\",\"type\":\"Float\"" wstring str3 = L"\"address\":\"test \\\ 00001\",\"type\":\"Float\"" wstring str4 = L"\"address\":\"test…
Austin
  • 29
  • 6
0
votes
2 answers

How to return base64 decoded image bytes through a methods formal parameter of type char**

Being new to C++, I am still struggling with pointers-to-pointers and I am not sure if my method below is returning decoded image bytes properly. This method gets a base64 encoded image string from API. The method has to follow this signature as it…
pixel
  • 9,653
  • 16
  • 82
  • 149
0
votes
1 answer

C++Rest SDK Passing a long data type into request body results in 400 Bad Request

My Swagger document defines a long data type expected to be sent in request like: size: type: integer format: int64 description: 'Some size' I create request using following code in C++: web::json::value postData =…
pixel
  • 9,653
  • 16
  • 82
  • 149
0
votes
2 answers

List to form-encoded parameters in Casablanca

I am using cpprestsdk (casabalanca) to POST a request to a server and I have a list of parameters std::list> query; query.push_back(std::make_pair("val1", "one two")); query.push_back(std::make_pair("val2", "yo")); that…
cprogrammer
  • 5,503
  • 3
  • 36
  • 56
0
votes
2 answers

Casablanca/cpprestsdk listener.support accepting functions but not methods

To support HTTP methods using Casablanca/cpprestsdk you can use code like this http_listener listener(U("http://localhost:10000/restdemo")); listener.support(methods::GET, handle_get); listener.support(methods::POST, handle_post); …
cmote
  • 79
  • 1
  • 8
0
votes
1 answer

Issues spawning a casablanca http_listener in a win32 service (C++)

For some reason, I am unable to start my listener in my windows services main thread, the code compiles without warnings and I get no linking errors, the cpprestsdk DLL is loaded correctly by the process (verified it with procmon) however, the…
0
votes
1 answer

error: passing ‘const string {aka const std::basic_string}’ as ‘this’ argument of ...discards qualifiers [-fpermissive]

I am trying to implement Websocket client using Cpprest sdk (Casablanca). I am successful in establishing the Web Socket connection and able to send/recieve messages. The response is received as an instance of websocket_incoming_message, which has…