Skip to content

Objective-C implementation of the URI Template spec.

License

Notifications You must be signed in to change notification settings

NDrive/CSURITemplate

 
 

Repository files navigation

CSURITemplate

Build Status

CSURITemplate is an Objective-C implementation of RFC6570: URI Template up to Level 4 of the spec.

Example usage:

NSError *error = nil;
CSURITemplate *template = [CSURITemplate URITemplateWithString:@"{?list*}"
                                                         error:&error];
NSDictionary *variables = @{@"list": @[@"red", @"green", @"blue"]};
NSString *uri = [template relativeStringWithVariables:variables error:&error];
assert([uri isEqualToString:@"?list=red&list=green&list=blue"]);

NSURL *baseURL = [NSURL URLWithString:@"http://www.example.com"];
NSURL *URL = [template URLWithVariables:variables relativeToURL:baseURL error:&error];
assert([uri isEqualToString:@"http://www.example.com?list=red&list=green&list=blue"]);

Installation

CocoaPods is the easiest way to use CSURITemplate.

platform :ios, '6.0'
pod 'CSURITemplate'

About

Objective-C implementation of the URI Template spec.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.9%
  • Ruby 1.1%