| Home | Libraries | People | FAQ | More

###### http::basic_fields::insert (3 of 8 overloads)

Insert a field.

###### Synopsis

    void
    insert(
        string_view name,
        string_view value);

###### Description

If one or more fields with the same name already exist, the new field will be inserted after the last field with the matching name, in serialization order. The value can be an empty string.

###### Parameters

Name | Description
--- | ---
`name` | The field name. It is interpreted as a case-insensitive string.
`value` | The field value.

###### Exceptions

Type | Thrown On
--- | ---

`boost::system::system_error`

Thrown if an error occurs:

- If the size of `name` exceeds `max_name_size`, the error code will be `error::header_field_name_too_large`.
- If the size of `value` exceeds `max_value_size`, the error code will be `error::header_field_value_too_large`.