nghttp3_conn_submit_request

Synopsis

#include <nghttp3/nghttp3.h>

int nghttp3_conn_submit_request(nghttp3_conn *conn, int64_t stream_id, const nghttp3_nv *nva, size_t nvlen, const nghttp3_data_reader *dr, void *stream_user_data)

nghttp3_conn_submit_request() submits HTTP request header fields and body on the stream identified by stream_id. stream_id must be a client initiated bidirectional stream. Only client can submit HTTP request. nva of length nvlen specifies HTTP request header fields. dr specifies a request body. If there is no request body, specify NULL. If dr is NULL, it implies the end of stream. stream_user_data is an opaque pointer attached to the stream.

This function returns 0 if it succeeds, or one of the following negative error codes:

NGHTTP3_ERR_INVALID_ARGUMENT

stream_id identifies unidirectional stream.

NGHTTP3_ERR_CONN_CLOSING

Connection is shutting down, and no new stream is allowed.

NGHTTP3_ERR_STREAM_IN_USE

Stream has already been opened.

NGHTTP3_ERR_NOMEM

Out of memory.