• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CFHTTPMessageAddAuthentication query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: CFHTTPMessageAddAuthentication query
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Read stream and proxies
  • Next by Date: Re: Open Transport on OS X
  • Previous by thread: Re: Read stream and proxies
  • Next by thread: Re: CFHTTPMessageAddAuthentication query
  • Index(es):
    • Date
    • Thread