Perform an HTTP GET and return a memory BIO holding the response body.

Synopsis

Declared in <openssl/http.h>

BIO*
OSSL_HTTP_get(
    char const* url,
    char const* proxy,
    char const* no_proxy,
    BIO* bio,
    BIO* rbio,
    OSSL_HTTP_bio_cb_t bio_update_fn,
    void* arg,
    int buf_size,
    stack_st_CONF_VALUE const* headers,
    char const* expected_content_type,
    int expect_asn1,
    size_t max_resp_len,
    int timeout);

Return Value

Memory BIO with the response body on success (caller frees), or NULL on failure.

Parameters

Name

Description

url

Absolute http:// or https:// URL to fetch.

proxy

Optional HTTP(S) proxy URL/host, or NULL to use environment defaults.

no_proxy

Optional host exclusion list, or NULL for environment defaults.

bio

Optional write BIO; NULL builds an internal connect BIO from url.

rbio

Optional read BIO paired with bio when both are non‐NULL.

bio_update_fn

Optional connect/TLS BIO callback (needed for https when bio is NULL).

arg

Opaque argument forwarded to bio_update_fn.

buf_size

Max header line length / read chunk; <= 0 uses the default.

headers

Optional additional request headers, or NULL.

expected_content_type

Required Content‐Type (exact or prefix), or NULL for any.

expect_asn1

Nonzero if the body must be ASN.1 DER.

max_resp_len

Maximum accepted response body length in bytes; 0 means unlimited.

timeout

Soft transfer timeout in seconds (<= 0 waits indefinitely where supported).

Created with MrDocs