cheerio/forms

Methods

# (static) serialize() → {string}

Encode a set of form elements as a string for submission.

Returns:

The serialized form.

Type
string

# (static) serializeArray() → {Array.<object>}

Encode a set of form elements as an array of names and values.

This:
Returns:

The serialized form.

Type
Array.<object>
Example
$('<form><input name="foo" value="bar" /></form>').serializeArray();
  //=> [ { name: 'foo', value: 'bar' } ]