i have this URL and I am trying to shorten it through bit.ly API. Here is my code
NSString *url = @"http://www.example.com&username=abc&password=123&mode=offline";
NSString *requestStr = [NSString stringWithFormat:@"http://api.bit.ly/v3/shorten?login=%@&apiKey=%@&longUrl=%@&format=txt",login, api_key, url];
requestStr = [requestStr stringByReplacingOccurrencesOfString:@"&" withString:@"&"];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:requestStr]];
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *response = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
I am getting a url in response which corresponds to only http://www.example.com
Surprisingly, &username=abc&password=123&mode=offline parts of the url are trimmed. This happens only when I am doing it through xcode. On the website, it is working properly. PLease help.