[#OSSL_HTTP_parse_url]
= OSSL&lowbar;HTTP&lowbar;parse&lowbar;url
:mrdocs:

Parse an http or https URL into allocated component strings&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OSSL&lowbar;HTTP&lowbar;parse&lowbar;url(
    char const* url,
    int* pssl,
    char** puser,
    char** phost,
    char** pport,
    int* pport&lowbar;num,
    char** ppath,
    char** pquery,
    char** pfrag);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *url*
| URL of the form &lsqb;http&lsqb;s&rsqb;&colon;&sol;&sol;&rsqb;&lsqb;userinfo@&rsqb;host&lsqb;&colon;port&rsqb;&lsqb;&sol;path&rsqb;&lsqb;?query&rsqb;&lsqb;&num;fragment&rsqb;&period;
| *pssl*
| Optional&semi; set to 1 if the scheme is https, else 0&period;
| *puser*
| Optional out for userinfo (empty string if absent)&semi; free with OPENSSL&lowbar;free&period;
| *phost*
| Optional out for host (IPv6 enclosed in brackets)&semi; free with OPENSSL&lowbar;free&period;
| *pport*
| Optional out for port string (defaults &quot;80&quot;&sol;&quot;443&quot;)&semi; free with OPENSSL&lowbar;free&period;
| *pport&lowbar;num*
| Optional out for the numeric port&period;
| *ppath*
| Optional out for path (always begins with &apos;&sol;&apos;)&semi; free with OPENSSL&lowbar;free&period;
| *pquery*
| Optional out for query (empty if absent)&semi; free with OPENSSL&lowbar;free&period;
| *pfrag*
| Optional out for fragment (empty if absent)&semi; free with OPENSSL&lowbar;free&period;
|===


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