[#OSSL_HTTP_get]
= OSSL&lowbar;HTTP&lowbar;get
:mrdocs:

Perform an HTTP GET and return a memory BIO holding the response body&period;

== Synopsis

Declared in `&lt;openssl&sol;http&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BIO.adoc[BIO]*
OSSL&lowbar;HTTP&lowbar;get(
    char const* url,
    char const* proxy,
    char const* no&lowbar;proxy,
    xref:BIO.adoc[BIO]* bio,
    xref:BIO.adoc[BIO]* rbio,
    xref:OSSL_HTTP_bio_cb_t.adoc[OSSL&lowbar;HTTP&lowbar;bio&lowbar;cb&lowbar;t] bio&lowbar;update&lowbar;fn,
    void* arg,
    int buf&lowbar;size,
    xref:stack_st_CONF_VALUE.adoc[stack&lowbar;st&lowbar;CONF&lowbar;VALUE] const* headers,
    char const* expected&lowbar;content&lowbar;type,
    int expect&lowbar;asn1,
    size&lowbar;t max&lowbar;resp&lowbar;len,
    int timeout);
----

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *url*
| Absolute http&colon;&sol;&sol; or https&colon;&sol;&sol; URL to fetch&period;
| *proxy*
| Optional HTTP(S) proxy URL&sol;host, or NULL to use environment defaults&period;
| *no&lowbar;proxy*
| Optional host exclusion list, or NULL for environment defaults&period;
| *bio*
| Optional write BIO&semi; NULL builds an internal connect BIO from `url&period;`
| *rbio*
| Optional read BIO paired with `bio` when both are non&hyphen;NULL&period;
| *bio&lowbar;update&lowbar;fn*
| Optional connect&sol;TLS BIO callback (needed for https when `bio` is NULL)&period;
| *arg*
| Opaque argument forwarded to `bio&lowbar;update&lowbar;fn&period;`
| *buf&lowbar;size*
| Max header line length &sol; read chunk&semi; &lt;&equals; 0 uses the default&period;
| *headers*
| Optional additional request headers, or NULL&period;
| *expected&lowbar;content&lowbar;type*
| Required Content&hyphen;Type (exact or prefix), or NULL for any&period;
| *expect&lowbar;asn1*
| Nonzero if the body must be ASN&period;1 DER&period;
| *max&lowbar;resp&lowbar;len*
| Maximum accepted response body length in bytes&semi; 0 means unlimited&period;
| *timeout*
| Soft transfer timeout in seconds (&lt;&equals; 0 waits indefinitely where supported)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
