From 4175e18b5ba080c22af8c8f0d92447577f5ba0be Mon Sep 17 00:00:00 2001 From: SirLynix Date: Fri, 9 Jun 2023 09:23:18 +0200 Subject: [PATCH] Examples/WebService: Switch URL --- examples/WebServices/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/WebServices/main.cpp b/examples/WebServices/main.cpp index d54d2ae7b..5ddcbb363 100644 --- a/examples/WebServices/main.cpp +++ b/examples/WebServices/main.cpp @@ -8,10 +8,13 @@ int main() std::unique_ptr webService = Nz::Network::Instance()->InstantiateWebService(); - std::unique_ptr webRequest = webService->CreateGetRequest("https://google.com", [&](const Nz::WebRequestResult& result) + std::unique_ptr webRequest = webService->CreateGetRequest("https://www.perdu.com", [&](const Nz::WebRequestResult& result) { if (result) - std::cout << "Got a response (" << result.GetDownloadedSize() << " bytes, " << result.GetDownloadSpeed() << " bytes/s" << ")" << std::endl; + { + std::cout << "Got a " << result.GetReponseCode() << " response(" << result.GetDownloadedSize() << " bytes, " << result.GetDownloadSpeed() << " bytes / s" << ")" << std::endl; + std::cout << result.GetBody() << std::endl; + } else std::cout << "Web request failed (code " << result.GetReponseCode() << "): " << result.GetErrorMessage() << std::endl;