Class FormBody
The fields of an application/x-www-form-urlencoded body, in order. A name may repeat (checkboxes, a list
field), so the form is a list of pairs; answers the first value of a name and
every one. Names compare ordinally, as HTML forms send them.
public sealed class FormBody : IReadOnlyList<KeyValuePair<string, string>>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable, ICloneable
Inheritance
Implements
Properties
this[int]
Gets the element at the specified index in the read-only list.
public KeyValuePair<string, string> this[int index] { get; }
Methods
Add(string, string)
Appends a field; a field with the same name may already be there.
public FormBody Add(string name, string value)
Clone()
A copy with its own field list (names and values are immutable strings).
public object Clone()
GetAll(string)
Every value of name, in order; empty when the field is absent.
public IReadOnlyList<string> GetAll(string name)
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
ToDictionary()
The fields as a dictionary of the first value of each name (later repeats are left out).
public Dictionary<string, string> ToDictionary()
Constructors
FormBody()
An empty form.
FormBody(IEnumerable<KeyValuePair<string, string>>)
A form with the given fields, in order.