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

1.3k Views Asked by At

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 searched many things.

But,there are no solutions request 'Get' with request header

RequestHeader is like this :

id:"1234567890"
auth:"7d8ffbecb05d59459f96d6e3aac8542e"

But I don't know what to do

httpclient client(U("http://localhost:9991/test"));
////then How???

I need your help!

1

There are 1 best solutions below

0
Ken On

all you need to do like

http_request request(methods::GET);
 request.headers().add(L"id", L"1234567890");
 request.headers().add(L"auth", L"7d8ffbecb05d59459f96d6e3aac8542e");