C# Class TweetSource.Util.HttpUtil

Utility class that takes care of most HTTP encoding/decoding things
Show file Open project: nkuln/tweetsource

Public Methods

Method Description
EncodeFormPostData ( NameValueCollection postData ) : string

Note: This is not the same as the way we encode query string

Esc ( string s ) : string

Escape string according to RFC 3986 - http://blog.nerdbank.net/2009/05/uriescapedatapath-and.html

EscapeUriDataStringRfc3986 ( string value ) : string

Escapes a string according to the URI data string rules given in RFC 3986.

The Uri.EscapeDataString method is supposed to take on RFC 3986 behavior if certain elements are present in a .config file. Even if this actually worked (which in my experiments it doesn't), we can't rely on every host actually having this configuration element present.

GetQueryString ( string url ) : string

Extract query string from a URL

QueryStringToNameValueCollection ( string query ) : NameValueCollection

Parse query string to NameValueCollection

RemoveQueryString ( string url ) : string

Remove query string from a URL

Method Details

EncodeFormPostData() public static method

Note: This is not the same as the way we encode query string
public static EncodeFormPostData ( NameValueCollection postData ) : string
postData System.Collections.Specialized.NameValueCollection
return string

Esc() public static method

Escape string according to RFC 3986 - http://blog.nerdbank.net/2009/05/uriescapedatapath-and.html
public static Esc ( string s ) : string
s string String to escape
return string

EscapeUriDataStringRfc3986() public static method

Escapes a string according to the URI data string rules given in RFC 3986.
The Uri.EscapeDataString method is supposed to take on RFC 3986 behavior if certain elements are present in a .config file. Even if this actually worked (which in my experiments it doesn't), we can't rely on every host actually having this configuration element present.
public static EscapeUriDataStringRfc3986 ( string value ) : string
value string The value to escape.
return string

GetQueryString() public static method

Extract query string from a URL
public static GetQueryString ( string url ) : string
url string URL
return string

QueryStringToNameValueCollection() public static method

Parse query string to NameValueCollection
public static QueryStringToNameValueCollection ( string query ) : NameValueCollection
query string query string to parse
return System.Collections.Specialized.NameValueCollection

RemoveQueryString() public static method

Remove query string from a URL
public static RemoveQueryString ( string url ) : string
url string URL
return string