nanomsg next generation NNG  
Home GitHub Documentation

This documentation is for version v1.2.2 of nng, but the latest released version is v1.8.0. see the documentation for v1.8.0 for the most up-to-date information.
nng_http_server_res_error(3http)

SYNOPSIS

#include <nng/nng.h>
#include <nng/supplemental/http/http.h>

int nng_http_server_res_error(nng_http_server *server,
        nng_http_res *response);

DESCRIPTION

The nng_http_server_res_error() sets the body of response to server's error page, which may have been customized using the nng_http_server_error_file() or nng_http_server_error_page() functions.

The status code of the response should have already been set, either implicitly by allocating it with nng_http_res_alloc_error(), or by calling nng_http_res_set_status().

Any content body previously set for response will be overridden by this function.

RETURN VALUES

This function returns 0 on success, and non-zero otherwise.

ERRORS

NNG_ENOMEM

Insufficient free memory exists.

NNG_ENOTSUP

HTTP not supported.

NNG Reference Manual vv1.2.2 © 2019 Staysail Systems, Inc, © 2018 Capitar IT Group BV
This document is supplied under the MIT License.
nanomsg™ and nng™ are trademarks of Garrett D'Amore.