mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-08 21:46:54 +08:00
3eb4eb8074
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
929 B
929 B
title | decl_name | symbol_kind | signature |
---|---|---|---|
mg_parse_uri() | mg_parse_uri | func | int mg_parse_uri(const struct mg_str uri, struct mg_str *scheme, struct mg_str *user_info, struct mg_str *host, unsigned int *port, struct mg_str *path, struct mg_str *query, struct mg_str *fragment); |
Parses an URI and fills string chunks with locations of the respective uri components within the input uri string. NULL pointers will be ignored.
General syntax:
[scheme://[user_info@]]host[:port][/path][?query][#fragment]
Example:
foo.com:80
tcp://foo.com:1234
http://foo.com:80/bar?baz=1
https://user:pw@foo.com:443/blah
path
will include the leading slash. query
won't include the leading ?
.
host
can contain embedded colons if surrounded by square brackets in order
to support IPv6 literal addresses.
Returns 0 on success, -1 on error.