Skip to main content

HttpClientExt

Assembly: ServiceStack.Text.dll​
View Source​
Declaration
public static class HttpClientExt

Methods​

MatchesContentType(HttpWebResponse, String)​

Case-insensitive, trimmed compare of two content types from start to ';', i.e. without charset suffix

View Source​
Declaration
public static bool MatchesContentType(this HttpWebResponse res, string matchesContentType)
Returns​

System.Boolean

Parameters​
TypeName
System.Net.HttpWebResponseres
System.StringmatchesContentType

GetContentLength(HttpWebResponse)​

Returns null for unknown Content-length Syntax + Behavior compatible with HttpClient HttpResponseMessage

View Source​
Declaration
public static long? GetContentLength(this HttpWebResponse res)
Returns​

System.Nullable<System.Int64>

Parameters​
TypeName
System.Net.HttpWebResponseres