<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.19" />

Microsoft.Rest.HttpExtensions

public static class HttpExtensions
Extensions for manipulating HTTP request and response objects.
public static string AsFormattedString(this HttpRequestMessage httpRequest)

Returns string representation of a HttpRequestMessage.

public static string AsFormattedString(this HttpResponseMessage httpResponse)

Returns string representation of a HttpResponseMessage.

public static string AsFormattedString<TKey, TValue>(this IDictionary<TKey, TValue> dictionary)

Converts given dictionary into a log string.

public static string AsString(this HttpContent content)

Formats an HttpContent object as String.

public static HttpHeaders GetContentHeaders(this HttpRequestMessage request)

Get the content headers of an HtttRequestMessage.

public static HttpHeaders GetContentHeaders(this HttpResponseMessage response)

Get the content headers of an HttpResponseMessage.

public static JObject GetHeadersAsJson(this HttpResponseMessage message)

Serializes HttpResponseHeaders and HttpContentHeaders as Json dictionary.

public static JObject ToJson(this HttpHeaders headers)

Serializes HttpHeaders as Json dictionary.

public static JObject ToJson(this IDictionary<string, IEnumerable<string>> headers)

Serializes header dictionary as Json dictionary.