You may encode the string using the -[NSString stringByAddingPercentEscapesUsingEncoding:]
method. Then, you just need to append the string to the URL.
NSString *URLPrefix = @"https://api.parse.com/1/classes/RandomObject";
NSString *encodedQuery = [@"where={\"arrayKey\":2}" stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", URLPrefix, encodedQuery]];
[request setURL:URL];