parse_url()

parse_url()#

Parse a URL into its components.

Prototype

PUBLIC int parse_url(
    const char  *url,
    char        *schema,
    int          schema_size,
    char        *host,
    int          host_size,
    char        *port,
    int          port_size,
    char        *path,
    int          path_size
);
        

Parameters

Key

Type

Description

url

const char *

The URL to parse.

schema

char *

Buffer to store the URL schema.

schema_size

int

The size of the schema buffer.

host

char *

Buffer to store the URL host.

host_size

int

The size of the host buffer.

port

char *

Buffer to store the URL port.

port_size

int

The size of the port buffer.

path

char *

Buffer to store the URL path.

path_size

int

The size of the path buffer.


Return Value

Returns 0 on success, or a negative value on failure.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples