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
2
votes
2 answers

What type to use when accessing and storing/parsing std::chrono::duration::milliseconds (cpprest)

A simplified example: //... std::chrono::milliseconds _delay; //field in question unsigned long getDelay() const { return _delay.count(); } void setDelay(unsigned long delay) { _delay = std::chrono::milliseconds(delay); } json::value…
CorellianAle
  • 645
  • 8
  • 16
2
votes
2 answers

how read a stream into a Concurrency::streams::streambuf buffer; in C++

I'm working with cpprestsdk in a project as a server. I need to read the Body of a put request. the documentation uses message.body().read_to_end(buffer); I tried this without success. void MyProject::handle_post(http_request message) { …
Daniel Santos
  • 14,328
  • 21
  • 91
  • 174
2
votes
1 answer

Build errors in cpprest sdk (casablanca) on Ubuntu 16.04

While searching for an HTTP client C++ based library, I have decided to use the casablanca -- so I needed to build it. I'm running on Ubuntu 16.04. While following the "common" build steps described here: How-to-build-for-Linux I have encountered a…
Guy Avraham
  • 3,482
  • 3
  • 38
  • 50
2
votes
0 answers

How to cancel http_request if client aborts in cpprestsdk?

I'm using http_listener to handle http requests from clients. The listener can only process limited requests in the same time, so some of the requests doesn't get a chance to be processed before its client peer aborts. In that case, I do not want…
user1633272
  • 2,007
  • 5
  • 25
  • 48
2
votes
1 answer

Ignore the CERTIFICATE_ERROR using CPP REST SDK

I have been using the CPP Rest SDK for my application which serves as both HTTP_Client and HTTP_Server as well. And now I want to support HTTPS in my application. The HTTP_Client will be running in HTTP and HTTP_Server will be running as HTTPS.…
2
votes
1 answer

How can I create a web::uri from a string to put into client.connect()?

A client.connect(web::uri) is required, but after looking into web::uri it won't accept a string. The api seems to say it can accept a string, but it won't and I can't figure out why. #include #include #include…
user7320433
2
votes
2 answers

Sending POST using cpprest

I have the following code to send POST, but I am getting an error with that even it compile correctly http_client client(U("http://l0.71.103.63:34568")); json::value postData; postData["name"] = json::value::string(U("Mohammad")); http_response…
2
votes
1 answer

WinHttpSendRequest: 2148074273 insufficient cache

I am building a Rest client with cpprest-sdk to communicate with a web service. The problem is that every once in a while, after sending multiple successful requests (around 50), I get the exception: WinHttpSendRequest: 2148074273 insufficient…
2
votes
0 answers

How can I issue a POST request that contains a basic authentication header, and a JSON body?

I am trying to use the CPPRESTSDK (a.k.a. Casablanca) to POST data to a RESTful server. To do this, I create a request, and assign a header: // create request, and add header information web::http::http_request…
jtmaher2
  • 482
  • 5
  • 19
1
vote
1 answer

Getting data from REST API using cpprestsdk

I am following Pixabay API documentation to retrieve/download images. I don't have a lot of understanding of URI/REST/HTTP workings but I was able to follow some documentation and get boilerplate code: int main() { auto fileStream =…
0726
  • 315
  • 2
  • 13
1
vote
1 answer

Turn off JSON value reorder in cpprestsdk

I'm using Microsoft's cpprestsdk to send a JSON from client to server. The problem is that the data I'm writing in the JSON isn't keeping it's original writing order, and it's being rearranged in alphabetical order. This is the function that returns…
Destard20
  • 13
  • 1
  • 6
1
vote
0 answers

C++ CppRest : Read file from http_request (multipart-form-data)

I am sending an audio file to my cpprest powered API, and I want to copy that file to a local directory on the server. However, I'm having trouble with actually getting the file from the http_request. I've tried two different approaches which I will…
1
vote
0 answers

Unresolved external symbol errors cpprestsdk

I was successfully built a cpprestsdk latest version 2.10.18 which I saw the cpprest141_2_10d.lib was on \Binaries\Debug folder and cpprest141_2_10.lib was on \Binaries\Release as well , but it has a problem when I tried to use it it…
Ken
  • 47
  • 6
1
vote
1 answer

How to extract bytes written to Concurrency::streams::fstream in cpprestsdk?

I created a simple client and server using CPPRESTSDK. The client sends an image and on the server, I save the incoming file and then start doing the processing phase afterwards. Now I want to check if the sent file is actually an image file and not…
Hossein
  • 24,202
  • 35
  • 119
  • 224
1
vote
1 answer

How to request with request header to https URL using C++ REST SDK?

I'm trying to make source that requests to specific https URL with request header using c++ rest sdk. ex)https://111.0.0.1:1111/vl/api/auth Then, I want to allocate response value to char* value and print. It is first time to use rest sdk. So I…
최주오
  • 11
  • 2