[#OSSL_HTTP_set1_request]
= OSSL&lowbar;HTTP&lowbar;set1&lowbar;request
:mrdocs:

Configure the HTTP request path, headers, body, and response expectations on `rctx&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OSSL&lowbar;HTTP&lowbar;set1&lowbar;request(
    xref:OSSL_HTTP_REQ_CTX.adoc[OSSL&lowbar;HTTP&lowbar;REQ&lowbar;CTX]* rctx,
    char const* path,
    xref:stack_st_CONF_VALUE.adoc[stack&lowbar;st&lowbar;CONF&lowbar;VALUE] const* headers,
    char const* content&lowbar;type,
    xref:BIO.adoc[BIO]* req,
    char const* expected&lowbar;content&lowbar;type,
    int expect&lowbar;asn1,
    size&lowbar;t max&lowbar;resp&lowbar;len,
    int timeout,
    int keep&lowbar;alive);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rctx*
| HTTP request context previously created with OSSL&lowbar;HTTP&lowbar;open() or OSSL&lowbar;HTTP&lowbar;REQ&lowbar;CTX&lowbar;new()&period;
| *path*
| Request&hyphen;URI path (or absolute http&colon;&sol;&sol; URI for a proxy)&semi; NULL defaults to &quot;&sol;&quot;&period;
| *headers*
| Optional additional request headers, or NULL&period;
| *content&lowbar;type*
| Content&hyphen;Type for `req` when a body is present, or NULL&period;
| *req*
| Optional BIO holding the request body, or NULL for a GET&hyphen;style request without a body&period;
| *expected&lowbar;content&lowbar;type*
| Expected response Content&hyphen;Type, or NULL to accept any&period;
| *expect&lowbar;asn1*
| Nonzero if the response body should be treated as ASN&period;1 DER&period;
| *max&lowbar;resp&lowbar;len*
| Maximum accepted response length in bytes&period;
| *timeout*
| Overall soft timeout in seconds for the exchange (&lt;&equals; 0 means none &sol; keep previous)&period;
| *keep&lowbar;alive*
| Keep&hyphen;alive preference (0 off, 1 on, 2 prefer and fail if unavailable)&period;
|===


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