microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.89k stars 1.63k forks source link

Getting only the status code and not getting response body on visual studio #1747

Closed nikhil1666 closed 10 months ago

nikhil1666 commented 1 year ago

1)I have tried using wait () method in this I am able to get only the status code . 2)if I execute the same request along with the same headers in postman I am able to get the entire response status code and body 3)I have thought compiler is skipping the response due to optimization so I have turned off all the optimization in properties no progress 4http_response resp = client.request(request); resp.wait();

git4744 commented 10 months ago

I had the same problem but referred to cpprestsdk-master\Release\samples\BingRequest to see how to get the body. Unfortunately, when I run this example, I am only seeing some of the body, not all of it.

nikhil1666 commented 10 months ago

Use wait/get to get the body.Its first creating a thread from start to end then using the get method is killing the thread and we are getting the results