I'm trying to request my company's Basecamp info for an internal project we're building. I understand how to add credentials in an ASP.NET environment but I'm new to iPad development and can't seem to get an appropriate response from Basecamp. Here's what I'm doing:
NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://mybasecampname.basecamphq.com/projects.xml"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0 ];
I'm adding the HTTP headers that Bsaecamp requires like so:
[theRequest setValue:@"application/xml" forHTTPHeaderField:@"Content-Type" ];
[theRequest setValue:@"application/xml" forHTTPHeaderField:@"Accept" ];
I know I also need to send my credentials for authentication purposes - my authentication token and any password I like but I'm not sure the best way to do this. Here's what I'm trying:
NSURLCredential *credential = [NSURLCredential credentialWithUser:@"MY TOKEN HERE"
password:@"x"
persistence:NSURLCredentialPersistenceForSession];
My question is: Am I on the right track here or am I missing something completely?
Here's a link to the Basecamp API details which explains what it needs: http://developer.37signals.com/basecamp/
Help appreciated.
Joe