in Dotnet/aws-iot-http-sigv4-dotnet-app/aws-iot-http-sigv4-dotnet-app/Utils/HttpHelper.cs [90:110]
public static HttpWebResponse GetResponse(HttpWebRequest request)
{
// Get the response and read any body into a string, then display.
using (var response = (HttpWebResponse)request.GetResponse())
{
if (response.StatusCode == HttpStatusCode.OK)
{
Logger.LogDebug("\n-- HTTP call succeeded");
var responseBody = ReadResponseBody(response);
if (!string.IsNullOrEmpty(responseBody))
{
Logger.LogDebug("\n-- Response body:");
Logger.LogDebug(responseBody);
}
}
else
Logger.LogDebug($"\n-- HTTP call failed, status code: {response.StatusCode}");
return response;
}
}