uri-template-ex
Implementation of RFC6570 URI Template Level 2
Overview
uri-template-ex is a crate that implements URL expansion and variable extraction (capture) using URI Template Level 2 as defined in RFC6570.
Since RFC6570 only defines variable expansion and not extraction, most existing URI Template implementations only support variable expansion and do not support extraction. This crate supports variable extraction using the same syntax as URI Template.
Features
- Variable expansion using RFC6570 URI Template Level 2
- Variable value extraction from URI templates
URI Template Level 2 supports the following 3 types of variables:
{var}{+var}{#var}
Installation
Add the following to your Cargo.toml:
[]
= "0.0.2"
Usage
Basic Usage Example
Example of generating a URI using a URI template:
use BTreeMap;
use UriTemplate;
Value Extraction from URI
Example of extracting values that match a template from a URI:
use UriTemplate;
License
This project is dual licensed under Apache-2.0/MIT. See the two LICENSE-* files for details.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.