Parse url into allocated scheme/user/host/port/path/query/fragment components.

Synopsis

Declared in <openssl/http.h>

int
OSSL_parse_url(
    char const* url,
    char** pscheme,
    char** puser,
    char** phost,
    char** pport,
    int* pport_num,
    char** ppath,
    char** pquery,
    char** pfrag);

Return Value

1 on success, or 0 on failure; free each returned string with OPENSSL_free().

Parameters

Name

Description

url

URL string to parse.

pscheme

Receives allocated scheme (for example "https"), or NULL to skip.

puser

Receives allocated userinfo, or NULL to skip.

phost

Receives allocated host, or NULL to skip.

pport

Receives allocated port string, or NULL to skip.

pport_num

Receives numeric port, or NULL to skip.

ppath

Receives allocated path (at least "/"), or NULL to skip.

pquery

Receives allocated query without leading '?', or NULL to skip.

pfrag

Receives allocated fragment without leading '#', or NULL to skip.

Created with MrDocs