Questions tagged [cpprest-sdk]

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design.

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design.

https://github.com/Microsoft/cpprestsdk

206 questions
1
vote
0 answers

Linking problem with boost when building cpprest-sdk on MacOs

I'm trying to create an HTTP client for a rest API using the cpprest-sdk library: https://github.com/Microsoft/cpprestsdk I'm using a MacBook Pro with the latest version of MacOs (10.14.2). I use brew as a package manager and have installed boost…
Robert Sjödahl
  • 734
  • 5
  • 19
1
vote
0 answers

boost::asio Host not found (authoritative) when running in Docker container based on busybox or alpine images

I'm currently working on a server written in C++ which uses cpprestsdk. cpprestsdk uses boost::asio. Much of my development is done on the Mac and not in a Docker container. When it come time to deploy a new version, I build to run in a Docker…
Mobile Ben
  • 7,121
  • 1
  • 27
  • 43
1
vote
0 answers

json cpprestsdk copy json object - parse function not doing a deep copy

I am having problems saving the JSON response using json cpprestsdk so that I can pass it back to the calling function. The parse() function seems to do a shallow copy rather than a deep copy. Can someone please help me with the method that I should…
QueryMan
  • 21
  • 3
1
vote
1 answer

Capture json response value and http status from cpprest sdk pplx task cpp to local variables

I want to write a generic function in cpp that gets JSON data using cpprestsdk and copy the http status response code and the JSON data. The calling method will use the json_resp and http_status codes. Later on, I want to further make this function…
QueryMan
  • 21
  • 3
1
vote
1 answer

Server-side-event C++ implementation?

I'm trying to implement a C++ server to generate event for a javascript EventSource, I'm building it with cpprest. From the examples I've seen in PHP or Node.js, it looked pretty straight-forward but I must be missing something since I'm getting…
VincentDM
  • 469
  • 6
  • 17
1
vote
2 answers

C++ Boost-iostream: mysterious error when including filtering_streambuf.hpp

I have been using the boost iostream library (version 1.65) mostly using following header: , with no problems. After I added another library called cpprest to my…
motam79
  • 3,542
  • 5
  • 34
  • 60
1
vote
2 answers

Microsoft/CppRestSDK Casablanca, Visual Studio 2017

The Goal Build a simple cpprestsdk example in Visual Studio. What I've done so far Following the guidelines on the wiki, I'm able to build a working example by cloning the git repository. But, I want to be able to link, include and setup the project…
1
vote
0 answers

exception thrown on cancelation when using ctrl+c

pplx::task RestInterface::Getsxxxx() { utility::stringstream_t ss; pplx::cancellation_token_source cts; pplx::cancellation_token ct = cts.get_token(); ss<<"http://"<
sabby
  • 21
  • 5
1
vote
1 answer

cpprest with japanese character?

The following code: auto nullValue = json::value::null(); std::string searchText = conversions::to_utf8string("michael"); make_request(client, methods::GET, nullValue, searchText); Returns the json data: {"data":[ { "_id":172,"name":"Michael…
noyruto88
  • 767
  • 2
  • 18
  • 40
1
vote
1 answer

How to parse multiple Set-Cookie generated by cpprestsdk?

tgw_l7_route=d0bf4a9ab78d53762b596c0a48dabcdf; Expires=Thu, 03-May-2018 11:42:51 GMT; Path=/, session=a1d25e28-0084-421d-ae71-9ae18c7f6b50; Expires=Sun, 03-Jun-2018 10:42:51 GMT; HttpOnly; Path=/ There are 2 Set-Cookie items joined by ', ', the…
user1633272
  • 2,007
  • 5
  • 25
  • 48
1
vote
1 answer

How to iterate through json objects with cpprest

I have a "jvalue" variable that holds a json data: { "data": [ { "_id": 123, "name": "Name 1" }, { "_id": 124, "name": "Name 2" } ], "success":…
noyruto88
  • 767
  • 2
  • 18
  • 40
1
vote
4 answers

How to keep server running (cpprestsdk - casablanca)

I am developing a REST api using Microsoft's cpprestsdk (aka casablanca) and I am having trouble keeping the server running when executing my code. See my main.cpp here: int main() { cout << "Starting Server" << endl; TransactionController…
Biggytiny
  • 519
  • 10
  • 29
1
vote
1 answer

How to extract specific data returned from web::json::value::serialize() with cpprestsdk/casablanca

I have this code: wcout << jvalue.serialize() << endl; which prints out the whole body of json data: { "data": { "timestamp": [ { "_id": "5ad93fc48084e1089cd9667b", "staff_id": 172, …
noyruto88
  • 767
  • 2
  • 18
  • 40
1
vote
1 answer

Displaying specific data from return data of api, C++ REST SDK a.k.a Casablanka

I'm new to c++ and visual c++ and working on accessing api using cpprestsdk aka casablanca. I managed to follow the tutorial from its github and able to display the return data in terminal. But I don't know how to display specific data. The return…
noyruto88
  • 767
  • 2
  • 18
  • 40
1
vote
1 answer

C++ REST SDK a.k.a Casablanka

How to cout or printf data return from api using c++ rest sdk aka casablanca? I got this code from tutorial: #include "stdafx.h" #include #include using namespace utility; // Common…
noyruto88
  • 767
  • 2
  • 18
  • 40