#include <iostream> #include "WinHttpWrapper.h" #include <string.h> void PrintDictionary(const std::unordered_map<std::wstring, std::wstring="">& dict); int main() { using namespace std; const wstring domain = L"localhost"; const wstring requestHeader = L"Content-Type: application/json"; int port = 7272; bool https = true; using namespace WinHttpWrapper; HttpRequest req(domain, port, https); HttpResponse response; req.Post(L"/api/Auth/register", requestHeader, R"({"Username":"Balksharma","Password":"Radhe@12332"})", response); cout << "Returned Status:" << response.statusCode << endl; cout << "Content Length:" << response.contentLength << endl; string token = "bearer " + response.text; wcout << endl << response.header << endl; cout << "Get the register data by id" << endl; req.Get(L"/api/Auth/GetId",L"", response); cout << "Returned Status:" << response.statusCode; cout << "Returned Text:"<< response.text << endl; response.Reset();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)