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

cpprestsdk http credentials setting gets 401 error

//Basic Authorization Setting http_client_config config; credentials creds(L"name", L"password"); config.set_credentials(creds); http_client client(U("http://severip/"), config); // create header http_request req(methods::GET); //// Add base64…
0
votes
1 answer

How to enable proxy using azure::storage?

azure::storage provides a class operation_context which has set_proxy() and set_default_proxy() methods. However, I could not find any info on how to use it. For example, how do I make sure that a cloud_blob_client created afterwards will use the…
bdristan
  • 1,048
  • 1
  • 12
  • 36
0
votes
1 answer

How to create a json object with hierarchical object and values?

How to create a hierarchical JSON object and value structure using Casablanca/cpprestsdk JSON library? I referred to the following links. But I could not figure out placing the JSON object in another JSON…
vinodkri
  • 33
  • 4
0
votes
0 answers

running lambda function inside Casablanca worker thread

How to pass an argument to a lambda function using Casablanca pplx::task ? Without Casablanca: auto f = [](int x) { cout <<"Hello "<
Debashish
  • 1,155
  • 19
  • 34
0
votes
1 answer

How do I set the listener() setting for external connection in Casablanca?

This code is accessible at 127.0.0.1. "http_listener listener("http://localhost:13654");" But... ...I don't know how to set up to connect from the outside. I tried (0.0.0.0) but failed. http_listener listener("http://0.0.0.0:13654"); How do I do…
Hwan E
  • 566
  • 2
  • 13
0
votes
2 answers

Crash inside http_client constructor (Casablanca SDK)

I'm trying to use Casablanca to consume a REST api. I've been following the microsoft tutorial, how ever i'm getting a crash and I cannot figure it out. I'm using visual studio 2017 with C++11 I've codded a function GetRequest() that do work when…
0
votes
1 answer

Sending multipart/related request via javascript and XmlHttpRequest

I'm trying to send multipart/related request to my own server based on cpprestsdk: POST /test HTTP/1.1 Content-Type: multipart/related; boundary=- --- Content-Type: application/json { "testField": "testValue" } --- Content-Type:…
Denis
  • 2,786
  • 1
  • 14
  • 29
0
votes
1 answer

cmake troubles with path to Includes And Libraries

i try to cross-compile my app to Raspberry Pi with docker. I built image with necessary dependencies from armhf architecture (protobuf-compiler-grpc:armhf libgrpc-dev:armhf libgrpc++-dev:armhf libprotobuf-dev:armhf libcpprest-dev:armhf…
0
votes
1 answer

Use cpprest (Casablanca) to return PDF response

I am using cpprest in a server on Ubuntu Linux. So far I am able to process requests, and reply with JSON responses. One of the requests that I accept needs to respond with a PDF file. I see that the http_request class has a reply() method that…
Jeff
  • 15
  • 5
0
votes
0 answers

File upload using cpprest giving 501 error as response

I am using code from the link https://msdn.microsoft.com/en-us/library/jj950081.aspx for uploading file anf getting response as 501 not implemented. // Upload a file to an HTTP server. pplx::task UploadFileToHttpServerAsync() { …
user3168064
  • 97
  • 2
  • 11
0
votes
2 answers

casablanca http_listener "Error adding url to url group"

I am currently trying to implement a REST interface with casablanca but I keep getting "Error adding url to url group". And I don't really know how to fix that. Here is my main method: int main(int argc, char* argv[]) { …
0
votes
1 answer

Casablanca test_runner fails with std::bad_alloc

I have built Casablanca on CentOS 7.5 using GCC 8.1.0 and Boost 1.6.7 (both built from source just previously). git clone https://github.com/Microsoft/cpprestsdk.git casablanca cd casablanca/Release mkdir build.debug cd build.debug cmake3 ..…
Gaius
  • 2,556
  • 1
  • 24
  • 43
0
votes
0 answers

How to know what parameter is taking a Lambda parameter section? c++

I am trying to understand the following code but I'm stuck at [=](ostream outFile){} this parameter is just declaring a new empty variable/class? or is getting any previous ostream value? If possible, please explain as much as you can because i'm…
0
votes
1 answer

http_client of cpprestsdk/casablanca

I have api https://api.gm-system.net/api/authenticate/searchStaffs/searchText which return a list staff. And here is my code to access this api using cpprestsdk with c++. auto fileStream = std::make_shared(); // Open stream to output…
noyruto88
  • 767
  • 2
  • 18
  • 40
0
votes
0 answers

When Cancelling application using Ctrl+c, cpprestSDK giving exception and core Dump

the REST server is up and running but no request from any client Now the user press Ctrl+c, then i get this exception. terminate called after throwing an instance of 'pplx::invalid_operation' what(): then() cannot be called on a default…
sabby
  • 21
  • 5