Source

uritemplate /

Filename Size Date modified Message
src/uritemplate
test/uritemplate/test
59 B
73 B
46 B
875 B
231 B
77.9 KB
# uritemplate

Creates uritemplates according to RFC 6570.
 
## Usage

- uritemplate: 
      
    (let [bitbucket (uritemplate "http://bitbucket.org/{user}/{project}")]
      (bitbucket {:user "dfa" :project "uritemplate"})) ; -> http://bitbucket.org/dfa/uritemplate

     	    
## Todo

- improve error reporting:
   + missing } in templates
   + empty templates
   + prefix together with explode
- uriparser?
    (let [example-parser (uri-parser "http://example.com/{role}/{user}")]
      (example-parser "http://example.com/admin/dfa")) ; yields {:role "admin"
      	  :user "user" }

## Inspired by

http://code.google.com/p/uri-templates/
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/util/UriTemplate.html

## License

Copyright (C) 2011-2012 Davide Angelocola

Distributed under the Eclipse Public License, the same as Clojure.