Method | Description | |
---|---|---|
Add ( string name, string value ) : void |
Add a name/value pair. Add doesn't overwrite any existing pairs with the same name, so in most cases, ReplaceAll is more appropriate.
|
|
AllValuesOf ( string name ) : string[] |
Returns all the values associated with the specified name. Returns an empty (zero-length) array if there aren't any. ValueOf is more convenient when there's exactly one name/value pair with the specified name.
|
|
Contains ( string name, string value ) : bool |
Check if a name/value pair is in the collection. It could exist more than once.
|
|
ContainsAny ( string name ) : bool |
Check if a particular name has any values. There could be more than one name/value pair with the specified name.
|
|
Remove ( string name, string value ) : void |
Remove a specific name/value pair. If the pair is in the collection more than once, this method will only remove one of them.
|
|
RemoveAll ( string name ) : void |
Remove all form variables with a particular name.
|
|
Replace ( string name, string oldValue, string newValue ) : void |
Replace a specific name/value pair.
|
|
ReplaceAll ( string name, string newValue ) : void |
Replace all form variables with a particular name. This is the same as calling RemoveAll and then Add.
|
|
ToString ( ) : string |
Serializes all the name/value pairs into a string. The format of the string matches the HTTP protocol specification for transmitting form variables to a server. This can be handy for checking the form variables in your web page. Generally you won't be sending it to a server because HttpClient handles that for you.
|
|
ValueOf ( string name ) : string |
Returns the value of the name/value pair with the specified name. Throws an exception if there aren't any pairs with that name or if there's more than one. Use AllValuesOf to handle cases where there isn't exactly one name/value pair with the requested name.
|
Method | Description | |
---|---|---|
AllIndexesOf ( string name ) : |
||
IndexOf ( string name, string value ) : int |
public Add ( string name, string value ) : void | ||
name | string | |
value | string | |
return | void |
public AllValuesOf ( string name ) : string[] | ||
name | string | |
return | string[] |
public Contains ( string name, string value ) : bool | ||
name | string | |
value | string | |
return | bool |
public Remove ( string name, string value ) : void | ||
name | string | |
value | string | |
return | void |
public Replace ( string name, string oldValue, string newValue ) : void | ||
name | string | |
oldValue | string | |
newValue | string | |
return | void |
public ReplaceAll ( string name, string newValue ) : void | ||
name | string | |
newValue | string | |
return | void |