Thursday, 29 August 2013

Opening a HTTP session with a username and password

Opening a HTTP session with a username and password

I am trying to open a HTTP session with a username and password using
AFNetworking.
The code I have at the moment is:
NSURL* serverURL = [NSURL URLWithString: @"http://myurl.com"];
AFHTTPClient* network = [[AFHTTPClient alloc] initWithBaseURL: serverURL];
[networkInstance setAuthorizationHeaderWithUsername:@"myUsername"
password:@"myPassword"];
Is this all there is to it? I've looked around a bit and I can't seem to
find any examples of a connection that uses a username and password.

No comments:

Post a Comment