OSSL_HTTP_set1_request

Configure the HTTP request path, headers, body, and response expectations on rctx.

Synopsis

Declared in <openssl/http.h>

int
OSSL_HTTP_set1_request(
    OSSL_HTTP_REQ_CTX* rctx,
    char const* path,
    stack_st_CONF_VALUE const* headers,
    char const* content_type,
    BIO* req,
    char const* expected_content_type,
    int expect_asn1,
    size_t max_resp_len,
    int timeout,
    int keep_alive);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
rctxHTTP request context previously created with OSSL_HTTP_open() or OSSL_HTTP_REQ_CTX_new().
pathRequest-URI path (or absolute http:// URI for a proxy); NULL defaults to "/".
headersOptional additional request headers, or NULL.
content_typeContent-Type for req when a body is present, or NULL.
reqOptional BIO holding the request body, or NULL for a GET-style request without a body.
expected_content_typeExpected response Content-Type, or NULL to accept any.
expect_asn1Nonzero if the response body should be treated as ASN.1 DER.
max_resp_lenMaximum accepted response length in bytes.
timeoutOverall soft timeout in seconds for the exchange (<= 0 means none / keep previous).
keep_aliveKeep-alive preference (0 off, 1 on, 2 prefer and fail if unavailable).