Re: URLAccess Stalls
Re: URLAccess Stalls
- Subject: Re: URLAccess Stalls
- From: Frederick Cheung <email@hidden>
- Date: Thu, 15 Dec 2005 19:19:02 +0000
On 15 Dec 2005, at 19:07, email@hidden wrote:
On Dec 14, 2005, at 5:55 PM, Marc Krochmal wrote:
We highly encourage you to make the transition to CFNetwork.
Here's some sample code to get you started. None of it contains
any Objective-C.
<http://developer.apple.com/samplecode/CFFTPSample/CFFTPSample.html>
<http://developer.apple.com/samplecode/CFNetworkHTTPDownload/
CFNetworkHTTPDownload.html>
Thanx, the examples don't look too bad. I'll just say if( OSX ) in
my class to decide whether to use URLAccess or CF, unless there is
a certain version of OS X where it would be a good idea to still
use URLAccess, like say 10.1?
OK, I actually have used http enough that I can run it from telnet,
I have functions to parse the headers and cookies, etc. I have
made Get/Set operators for key/valye pairs that act a lot like
associative arrays in javascript. So I could probably program the
whole thing now over a socket, although it would be ugly. Do NSURL
or CFHTTPStream, or even CFNetwork have functions for individual
items in the header?
CFHTTPMessage will parse the headers for you
(CFHTTPMessageCopyAllHeaderFields;
CFHTTPMessageCopyHeaderFieldValue ), and will enable you to set the
headers (CFHTTPMessageSetHeaderFieldValue).
NSMutableURLRequest will do that as well. On the cocoa side there are
the NSHTTPCookie/NSHTTPCookieStorage will create/parse the relevant
cookie headers.
And what I really need is SSL support. I want to be able to just
type https in the URL and have it "just work". I'm wondering which
of the methods is better for that.
CFHTTP will do that just fine.
Also, I have never done anything with a proxy server, but should I
need that, is there a way to just add it in, and which of these
would be better for that?
SCDynamicStoreCopyProxies gets you a CFDictionary with the current
system proxy settings that you can stick straight into the CFHTTP
functions. If your proxy requires authentication you have to do a
little more work with the Keychain if you want to be able to grab the
password the user has stored for the proxy.
Fred
_______________________________________________
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