nategood / httpful

A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.
MIT License
1.74k stars 299 forks source link

Add support for URI Templates #3

Open nategood opened 12 years ago

nategood commented 12 years ago

As part of the Request Template support, it would be nice to also include a URI template seeing as most requests to a URI come from the same base URI.

http://tools.ietf.org/html/draft-gregorio-uritemplate-04

nategood commented 12 years ago

URI Templates provide a mechanism for abstracting a space of resource identifiers such that the variable parts can be easily identified and described. URI templates can have many uses, including discovery of available services, configuring resource mappings, defining computed links, specifying interfaces, and other forms of programmatic interaction with resources. For example, the above resources could be described by the following URI templates:

 http://example.com/~{username}/
 http://example.com/dictionary/{term:1}/{term}
 http://example.com/search{?q,lang}

We define the following terms: