CFHTTPMessageAddAuthentication query
CFHTTPMessageAddAuthentication query
- Subject: CFHTTPMessageAddAuthentication query
- From: Trygve Inda <email@hidden>
- Date: Wed, 10 May 2006 12:00:19 +0000
- Thread-topic: CFHTTPMessageAddAuthentication query
I need to authenticate to use a proxy.
My code is based on the CFHTTP Download sample and goes something like (some
stuff removed):
messageRef = CFHTTPMessageCreateRequest (kCFAllocatorDefault, CFSTR("GET"),
dInfo->mURLRef, kCFHTTPVersion1_1);
dInfo->mReadStreamRef = CFReadStreamCreateForHTTPRequest
(kCFAllocatorDefault, messageRef);
proxyDict = SCDynamicStoreCopyProxies (NULL);
CFReadStreamSetProperty (dInfo->mReadStreamRef, kCFStreamPropertyHTTPProxy,
proxyDict);
CFReadStreamSetClient (dInfo->mReadStreamRef, kNetworkEvents,
HTTP_ReadStreamClientCallBack, &ctxt)
CFReadStreamScheduleWithRunLoop (dInfo->mReadStreamRef,
CFRunLoopGetCurrent(), kCFRunLoopCommonModes);
CFReadStreamOpen (dInfo->mReadStreamRef)
CFRelease (messageRef)
So then in my callback, I need to look for a 407 error, true?
How do I get the data to be passed back to CFHTTPMessageAddAuthentication ?
request: is this just the original messageRef? It has already been attached
to the stream? It has also been released?
authenticationFailureResponse: how do I get this out of my callback (what
property is it looking for?) which looks a bit like:
case kCFStreamEventHasBytesAvailable:
cfHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty (stream,
kCFStreamPropertyHTTPResponseHeader);
dInfo->mStatus = CFHTTPMessageGetResponseStatusCode (cfHeader);
Is there some sample code to do this?
Thanks,
Trygve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden