| Home | Libraries | People | FAQ | More

###### http::message::reason (2 of 2 overloads)

(Inherited from `http::header`)

Set the response reason-phrase (deprecated)

<h7> Synopsis </h7>

    void
    reason(
        string_view s);

<h7> Description </h7>

This function sets a custom reason-phrase to a copy of the string passed in. Normally it is not necessary to set the reason phrase on an outgoing response object; the implementation will automatically use the standard reason text for the corresponding status code. To clear a previously set custom phrase, pass an empty string. This will restore the default standard reason text based on the status code used when serializing. The reason-phrase is obsolete as of rfc7230.

<h7> Parameters </h7>

Name | Description
--- | ---
`s` | The string to use for the reason-phrase.

<h7> Remarks </h7>

This function is only available when `isRequest == false`.