libboost-url/1.83.0

[brief]

URL parsing in C++11

Boost.URL

Branch master develop
Docs Documentation Documentation
Drone Build Status Build Status
GitHub Actions CI CI
codecov.io codecov codecov
Matrix Matrix Matrix

Boost.URL

Overview

Boost.URL is a portable C++ library which provides containers and algorithms which model a "URL", more formally described using the Uniform Resource Identifier (URI) specification (henceforth referred to as rfc3986). A URL is a compact sequence of characters that identifies an abstract or physical resource. For example, this is a valid URL which satisfies the absolute-URI grammar:

https://www.example.com/path/to/file.txt?userid=1001&page=2&results=full

This library understands the various grammars related to URLs and provides for validating and parsing of strings, manipulation of URL strings, and algorithms operating on URLs such as normalization and resolution. While the library is general purpose, special care has been taken to ensure that the implementation and data representation are friendly to network programs which need to handle URLs efficiently and securely, including the case where the inputs come from untrusted sources. Interfaces are provided for using error codes instead of exceptions as needed, and all algorithms provide a mechanism for avoiding memory allocations entirely if desired. Another feature of the library is that all container mutations leave the URL in a valid state. Code which uses Boost.URL will be easy to read, flexible, and performant.

Network programs such as those using Boost.Asio or Boost.Beast often encounter the need to process, generate, or modify URLs. This library provides a very much needed modular component for handling these use-cases.

Example

using namespace boost::urls;

// Parse a URL. This allocates no memory. The view
// references the character buffer without taking ownership.
//
url_view uv( "https://www.example.com/path/to/file.txt?id=1001&name=John%20Doe&results=full" );

// Print the query parameters with percent-decoding applied
//
for( auto v : uv.params() )
    std::cout << v.key << "=" << v.value << " ";

// Prints: id=1001 name=John Doe results=full

// Create a modifiable copy of `uv`, with ownership of the buffer
//
url u = uv;

// Change some elements in the URL
//
u.set_scheme( "http" )
 .set_encoded_host( "boost.org" )
 .set_encoded_path( "/index.htm" )
 .remove_query()
 .remove_fragment()
 .params().append( {"key", "value"} );

std::cout << u;

// Prints: http://boost.org/index.htm?key=value

Design Goals

The library achieves these goals:

Requirements

Header-Only

To use as header-only; that is, to eliminate the requirement to link a program to a static or dynamic Boost.URL library, simply place the following line in exactly one new or existing source file in your project.

#include <boost/url/src.hpp>

Embedded

Boost.URL works great on embedded devices. It can be used in a way that avoids all dynamic memory allocations. Furthermore it is designed to work without exceptions if desired.

Supported Compilers

Boost.URL is tested with the following compilers:

and these architectures: x86, x64, ARM64, S390x

Quality Assurance

The development infrastructure for the library includes these per-commit analyses:

Visual Studio Solution Generation

cmake -G "Visual Studio 16 2019" -A Win32 -B bin -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/msvc.cmake
cmake -G "Visual Studio 16 2019" -A x64 -B bin64 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/msvc.cmake

License

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

version 1.83.0
license BSL-1.0Boost Software License 1.0
repository https://pkg.cppget.org/1/stable
download libboost-url-1.83.0.tar.gz
sha256 7675c4bc7aa5d3a43c188fba8e6ecd2ff08abe7e04e0ed5a90bb0a13d731cee0
project boost
url github.com/boostorg/url
doc-url www.boost.org/doc/libs/1_83_0/libs/url
package-url github.com/build2-packaging/boost
package-email packaging@build2.orgMailing list
topics C++Boost

Depends (11)

libboost-throw-exception == 1.83.0
libboost-align == 1.83.0
libboost-assert == 1.83.0
libboost-config == 1.83.0
libboost-core == 1.83.0
libboost-mp11 == 1.83.0
libboost-optional == 1.83.0
libboost-static-assert == 1.83.0
libboost-system == 1.83.0
libboost-type-traits == 1.83.0
libboost-variant2 == 1.83.0

Reviews

fail 0
pass 1

Builds

toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_12-bindist
timestamp 2025-08-23 15:51:52 UTC (03:02:23 hours ago)
result warning (update) | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14-ndebug_O3
timestamp 2025-08-23 09:02:25 UTC (09:51:50 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14-O3
timestamp 2025-08-23 08:56:04 UTC (09:58:10 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14
timestamp 2025-08-23 08:46:31 UTC (10:07:44 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14-static_O3
timestamp 2025-08-23 08:44:45 UTC (10:09:30 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_fedora_40-gcc_14-bindist
timestamp 2025-08-22 20:18:56 UTC (22:35:18 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.10
timestamp 2025-08-22 16:26:25 UTC (01 02:27:49 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_17_msvc_msvc_17.10
timestamp 2025-08-22 16:26:04 UTC (01 02:28:10 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.10-static_O2
timestamp 2025-08-22 16:24:26 UTC (01 02:29:49 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.10-O2
timestamp 2025-08-22 16:23:59 UTC (01 02:30:15 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_18_llvm_msvc_17.10-O2
timestamp 2025-08-22 16:21:58 UTC (01 02:32:16 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.8-O2
timestamp 2025-08-22 16:19:24 UTC (01 02:34:50 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.8
timestamp 2025-08-22 16:16:04 UTC (01 02:38:10 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_13.2_mingw_w64-O2
timestamp 2025-08-22 16:15:50 UTC (01 02:38:24 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_13.2_mingw_w64
timestamp 2025-08-22 16:13:06 UTC (01 02:41:09 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.8-static_O2
timestamp 2025-08-22 16:12:09 UTC (01 02:42:06 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_18_llvm_msvc_17.10
timestamp 2025-08-22 16:11:08 UTC (01 02:43:06 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_18_llvm_msvc_17.10-static_O2
timestamp 2025-08-22 16:09:22 UTC (01 02:44:52 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_13.2_mingw_w64-static_O2
timestamp 2025-08-22 16:07:38 UTC (01 02:46:37 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14-ndebug_O3
timestamp 2025-08-22 16:04:09 UTC (01 02:50:06 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14-O3
timestamp 2025-08-22 16:03:41 UTC (01 02:50:33 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14
timestamp 2025-08-22 16:00:03 UTC (01 02:54:12 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_ubuntu_24.04-gcc_13-bindist
timestamp 2025-08-22 15:55:44 UTC (01 02:58:31 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd13.3
tgt config freebsd_13-clang_17
timestamp 2025-08-22 15:52:03 UTC (01 03:02:11 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14-static_O3
timestamp 2025-08-22 15:50:08 UTC (01 03:04:06 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_17_libc++
timestamp 2025-08-22 15:47:01 UTC (01 03:07:13 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd14.1
tgt config freebsd_14-clang_18-O3
timestamp 2025-08-22 15:46:47 UTC (01 03:07:27 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd14.1
tgt config freebsd_14-clang_18
timestamp 2025-08-22 15:41:52 UTC (01 03:12:23 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_17
timestamp 2025-08-22 15:40:55 UTC (01 03:13:19 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd14.1
tgt config freebsd_14-clang_18-static_O3
timestamp 2025-08-22 15:37:39 UTC (01 03:16:36 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_13.1
timestamp 2025-08-22 15:37:11 UTC (01 03:17:03 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_17_libc++
timestamp 2025-08-22 11:06:22 UTC (01 07:47:53 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_17
timestamp 2025-08-22 11:05:26 UTC (01 07:48:48 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_13
timestamp 2025-08-22 10:34:13 UTC (01 08:20:02 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-static_O3
timestamp 2025-08-20 23:38:28 UTC (02 19:15:47 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-O3
timestamp 2025-08-20 23:35:15 UTC (02 19:18:59 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18-static_O3
timestamp 2025-08-20 23:32:14 UTC (02 19:22:00 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18_libc++
timestamp 2025-08-20 23:30:37 UTC (02 19:23:37 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18-O3
timestamp 2025-08-20 23:28:24 UTC (02 19:25:50 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18
timestamp 2025-08-20 23:26:37 UTC (02 19:27:37 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18-O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18-static_O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18_libc++
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-static_O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_fedora_39-gcc_13-bindist
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_15.0
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-clang_15.0
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-clang_15.0-O3
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-clang_15.0-static_O3
result unbuilt
target x86_64-apple-darwin23.5.0
tgt config macos_14-gcc_14_homebrew
result excluded (https://github)
target x86_64-apple-darwin23.5.0
tgt config macos_14-gcc_14_homebrew-O3
result excluded (https://github)
target x86_64-apple-darwin23.5.0
tgt config macos_14-gcc_14_homebrew-static_O3
result excluded (https://github)