Camel.URL
Description: Reference for Camel.URL

### Struct

# CamelURL

#### Description [src]

    struct CamelURL {
      gchar* protocol;
      gchar* user;
      gchar* authmech;
      gchar* host;
      gint port;
      gchar* path;
      GData* params;
      gchar* query;
      gchar* fragment;
    }

URI parsing, encoding, and manipulation.

`CamelURL` provides a URI parser, encoder, and logic for merging relative URIs with base URIs. When a URI string is parsed, it is split into its constituent parts and stored in a decoded form: protocol, user, authentication mechanism, password, host, port, path, query parameters, query string, and fragment.

Field values are read directly from the struct members, but should only be written via the camel_url_set_*() accessor functions, which manage memory correctly.

`camel_url_to_string()` serialises a `CamelURL` back to a string, with optional flags to hide sensitive fields such as URI parameters (e.g. `CAMEL_URL_HIDE_PARAMS`) or authentication details (e.g. `CAMEL_URL_HIDE_AUTH`).

`camel_url_new_with_base()` creates a new URI by resolving a relative URI string against a base `CamelURL`, following all relevant RFC rules.

`camel_url_encode()` and `camel_url_decode()` handle percent-encoding (%`XX` escaping) of URI components.

###### Structure members

`protocol:` `gchar*`

  No description available.

`user:` `gchar*`

  No description available.

`authmech:` `gchar*`

  No description available.

`host:` `gchar*`

  No description available.

`port:` `gint`

  No description available.

`path:` `gchar*`

  No description available.

`params:` `GData`

  No description available.

`query:` `gchar*`

  No description available.

`fragment:` `gchar*`

  No description available.

#### Constructors

###### camel_url_new

Parses an absolute URL.

#### Functions

###### camel_url_addrspec_end

No description available.

###### camel_url_addrspec_start

No description available.

###### camel_url_decode

%-decodes the passed-in URL in place. The decoded version is never longer than the encoded version, so there does not need to be any additional space at the end of the string.

###### camel_url_decode_path

No description available.

###### camel_url_encode

This %-encodes the given URL part and returns the escaped version in allocated memory, which the caller must free when it is done.

###### camel_url_file_end

No description available.

###### camel_url_file_start

No description available.

###### camel_url_web_end

No description available.

###### camel_url_web_start

No description available.

#### Instance methods

###### camel_url_copy

Copy a `CamelURL`.

###### camel_url_equal

No description available.

###### camel_url_free

Frees `url`.

###### camel_url_get_param

Get the value of the specified param on the URL.

###### camel_url_hash

No description available.

###### camel_url_new_with_base

Parses `url_string` relative to `base`.

###### camel_url_set_authmech

Set the authmech of a `CamelURL`.

###### camel_url_set_fragment

Set the fragment of a `CamelURL`.

###### camel_url_set_host

Set the hostname of a `CamelURL`.

###### camel_url_set_param

Set a param on the `CamelURL`.

###### camel_url_set_path

Set the path component of a `CamelURL`.

###### camel_url_set_port

Set the port on a `CamelURL`.

###### camel_url_set_protocol

Set the protocol of a `CamelURL`.

###### camel_url_set_query

Set the query of a `CamelURL`.

###### camel_url_set_user

Set the user of a `CamelURL`.

###### camel_url_to_string

Flatten a `CamelURL` into a string.