Re: Force authentication with NSURLConnection
Re: Force authentication with NSURLConnection
- Subject: Re: Force authentication with NSURLConnection
- From: "Justin R. Miller" <email@hidden>
- Date: Fri, 16 Mar 2007 12:57:31 -0400
On Mar 12, 2007, at 5:02 PM, Dave Dribin wrote:
The API uses basic HTTP authentication, but it does not return
401s. This is because the same URLs are used for the API as well
as the normal web interface (which uses form-based auth). The
backend determines an API vs. web browser based on the Accept HTTP
header (i.e. if it's "application/xml" it must be an API call). It
is assumed that API clients will always use authentication,
regardless of the missing 401.
Boy, can't say I've ever heard of that before. That strikes me as
kind of different.
Are you forming an NSURLRequest? Could you use its method:
-(NSString *)valueForHTTPHeaderField:(NSString *)field
to set your Accept-HTTP header?
--
Justin R. Miller
Code Sorcery Workshop
http://codesorcery.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden