Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (NSURL *)hitListURLWithTaskTitle:(NSString *)title {
- // Basic URL as a starting point
- NSURLComponents *components = [NSURLComponents componentsWithString:@"thehitlist:///inbox/tasks"];
- components.queryItems = @[
- [NSURLQueryItem queryItemWithName:@"method" value:@"POST"],
- [NSURLQueryItem queryItemWithName:@"title" value:title]
- ];
- // NSURLQueryItem has encoded any spaces as %20 which is fine
- // But + symbols are untouched, which will be mis-interpreted
- // So post-process to encode them ourselves
- components.percentEncodedQuery = [components.percentEncodedQuery
- stringByReplacingOccurrencesOfString:@"+"
- withString:@"%2B"];
- return components.URL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement