Merge tag 'upstream/0.19'
[liburi-template-perl.git] / README
1 NAME
2     URI::Template - Object for handling URI templates (RFC 6570)
3
4 SYNOPSIS
5         use URI::Template;
6    
7         my $template = URI::Template->new( 'http://example.com/{x}' );
8         my $uri      = $template->process( x => 'y' );
9
10         # or
11     
12         my $template = URI::Template->new();
13         $template->template( 'http://example.com/{x}' );
14         my $uri      = $template->process( x => 'y' );
15     
16         # uri is a URI object with value 'http://example.com/y'
17
18 DESCRIPTION
19     This module provides a wrapper around URI templates as described in RFC
20     6570: <http://tools.ietf.org/html/rfc6570>.
21
22 INSTALLATION
23         perl Makefile.PL
24         make
25         make test
26         make install
27
28 METHODS
29   new( $template )
30     Creates a new URI::Template instance with the template passed in as the
31     first parameter (optional).
32
33   template( $template )
34     This method returns the original template string. If provided, it will
35     also set and parse a new template string.
36
37   variables
38     Returns an array of unique variable names found in the template. NB:
39     they are returned in random order.
40
41   expansions
42     This method returns an list of expansions found in the template.
43     Currently, these are just coderefs. In the future, they will be more
44     interesting.
45
46   process( \%vars )
47     Given a list of key-value pairs or an array ref of values (for
48     positional substitution), it will URI escape the values and substitute
49     them in to the template. Returns a URI object.
50
51   process_to_string( \%vars )
52     Processes input like the "process" method, but doesn't inflate the
53     result to a URI object.
54
55 AUTHORS
56     *   Brian Cassidy <bricas@cpan.org>
57
58     *   Ricardo SIGNES <rjbs@cpan.org>
59
60 COPYRIGHT AND LICENSE
61     Copyright 2007-2015 by Brian Cassidy
62
63     This library is free software; you can redistribute it and/or modify it
64     under the same terms as Perl itself.
65