@@ -10,7 +10,7 @@ namespace AppInstaller::Repository::Rest::Schema
10
10
pplx::task<web::http::http_response> HttpClientHelper::Post (
11
11
const utility::string_t & uri, const web::json::value& body, const std::unordered_map<utility::string_t , utility::string_t >& headers) const
12
12
{
13
- AICLI_LOG (Repo, Verbose , << " Sending http POST request to: " << utility::conversions::to_utf8string (uri));
13
+ AICLI_LOG (Repo, Info , << " Sending http POST request to: " << utility::conversions::to_utf8string (uri));
14
14
web::http::client::http_client client = GetClient (uri);
15
15
web::http::http_request request{ web::http::methods::POST };
16
16
request.headers ().set_content_type (web::http::details::mime_types::application_json);
@@ -22,6 +22,8 @@ namespace AppInstaller::Repository::Rest::Schema
22
22
request.headers ().add (pair.first , pair.second );
23
23
}
24
24
25
+ AICLI_LOG (Repo, Verbose, << " Http POST request details:\n " << utility::conversions::to_utf8string (request.to_string ()));
26
+
25
27
return client.request (request);
26
28
}
27
29
@@ -31,17 +33,16 @@ namespace AppInstaller::Repository::Rest::Schema
31
33
web::http::http_response httpResponse;
32
34
HttpClientHelper::Post (uri, body, headers).then ([&httpResponse](const web::http::http_response& response)
33
35
{
34
- AICLI_LOG (Repo, Verbose, << " Response status: " << response.status_code ());
35
36
httpResponse = response;
36
37
}).wait ();
37
38
38
- return ValidateAndExtractResponse (httpResponse);
39
+ return ValidateAndExtractResponse (httpResponse);
39
40
}
40
41
41
42
pplx::task<web::http::http_response> HttpClientHelper::Get (
42
43
const utility::string_t & uri, const std::unordered_map<utility::string_t , utility::string_t >& headers) const
43
44
{
44
- AICLI_LOG (Repo, Verbose , << " Sending http GET request to: " << utility::conversions::to_utf8string (uri));
45
+ AICLI_LOG (Repo, Info , << " Sending http GET request to: " << utility::conversions::to_utf8string (uri));
45
46
web::http::client::http_client client = GetClient (uri);
46
47
web::http::http_request request{ web::http::methods::GET };
47
48
request.headers ().set_content_type (web::http::details::mime_types::application_json);
@@ -52,6 +53,8 @@ namespace AppInstaller::Repository::Rest::Schema
52
53
request.headers ().add (pair.first , pair.second );
53
54
}
54
55
56
+ AICLI_LOG (Repo, Verbose, << " Http GET request details:\n " << utility::conversions::to_utf8string (request.to_string ()));
57
+
55
58
return client.request (request);
56
59
}
57
60
@@ -61,11 +64,10 @@ namespace AppInstaller::Repository::Rest::Schema
61
64
web::http::http_response httpResponse;
62
65
Get (uri, headers).then ([&httpResponse](const web::http::http_response& response)
63
66
{
64
- AICLI_LOG (Repo, Verbose, << " Response status: " << response.status_code ());
65
67
httpResponse = response;
66
68
}).wait ();
67
69
68
- return ValidateAndExtractResponse (httpResponse);
70
+ return ValidateAndExtractResponse (httpResponse);
69
71
}
70
72
71
73
web::http::client::http_client HttpClientHelper::GetClient (const utility::string_t & uri) const
@@ -83,6 +85,9 @@ namespace AppInstaller::Repository::Rest::Schema
83
85
84
86
std::optional<web::json::value> HttpClientHelper::ValidateAndExtractResponse (const web::http::http_response& response) const
85
87
{
88
+ AICLI_LOG (Repo, Info, << " Response status: " << response.status_code ());
89
+ AICLI_LOG (Repo, Verbose, << " Response details: " << utility::conversions::to_utf8string (response.to_string ()));
90
+
86
91
std::optional<web::json::value> result;
87
92
switch (response.status_code ())
88
93
{
0 commit comments