boost::urls::static_url::set_zone_id :: Boost Libraries Documentation

# boost::urls::static_url::set_zone_id

Set the zone ID for an IPv6 address.

## Synopsis

Declared in `<boost/url/static_url.hpp>`

    static_url&
    set_zone_id(core::string_view s);

## Description

This function sets the zone ID for the host if the host is an IPv6 address. Reserved characters in the string are percent‐escaped in the result.

## Example

    assert( u.set_host_ipv6( ipv6_address( "fe80::1" ) ).set_zone_id( "eth0" ).buffer() == "https://[fe80::1%25eth0]" );

## Complexity

Linear in `this‐>size()`.

## Exception Safety

Strong guarantee. Calls to allocate may throw.

## Specification

- RFC 6874

## Return Value

`*this`

## Parameters

Name | Description
s | The zone ID to set.

Created with MrDocs