nghttp2_conn_submit_request
Synopsis
#include <nghttp2v2/nghttp2.h>
-
int64_t nghttp2_conn_submit_request(nghttp2_conn *conn, const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_reader *dr, void *stream_user_data)
nghttp2_conn_submit_request()creates new stream and submits HTTP request header fields and the optional request body. 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, specifyNULL. If dr isNULL, it implies the end of stream.This function returns the stream ID if it succeeds. To know the stream ID before calling this function, use
nghttp2_conn_get_next_stream_id().This function returns the stream ID that the new stream is designated with if it succeeds, or one of the following negative error codes:
NGHTTP2_ERR_NOMEMOut of memory.
NGHTTP2_ERR_REFUSED_STREAMConnection is shutting down, and no new stream is allowed.
NGHTTP2_ERR_STREAM_ID_BLOCKEDThe remote endpoint does not allow stream_id yet.