/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Http_response response=client request (the methods: : POST, builder. To_string (), postData). The get ();
I want to set the transfer head
Client. Add_handler ();
Transfer
But don't know
Accept: application/json how to join in..
Cpprestsdkv141
2.10.12.1
Read the older can't use Microsoft document...
Refer to add ~
CodePudding user response:
Set the header information in the file cpprestsdk/Release/include/cpprest/http_client hIf you want to set to json format, my way is like this:
Web: : uri uri (U (" http://localhost:80/client "));
Web: HTTP: : client: : http_client client (uri).
Web: HTTP: : http_request request2 (the methods: POST);
Request2. Set_request_uri (uri);
Request2. Set_body (STR, "text/json");
The hope can help you