An NSURLHandle instance is used to manage the resource data corresponding to an NSURL object. A single NSURLHandle can be used to manage multiple NSURL objects as long as those objects all refer to the same resource.
Different NSURLHandle subclasses are used to manage different types of URL (usually based on the scheme of the URL), and you can register new subclasses to extend (or replace) the standard ones.
GNUstep comes with private subclasses to handle the common URL schemes -
file:
(local file I/O)
http
and shttp
(webserver) access.
YES
. If there is no such subclass, returns nil.
This is a PRIVATE subclass of NSURLHandle. It is documented here in order to give you information about the default behavior of an NSURLHandle created to deal with a URL that has the FILE scheme. The name and/or other implementation details of this class may be changed at any time.
A GSFileURLHandle instance is used to manage files on the local file-system of your machine.
This is a PRIVATE subclass of NSURLHandle.
It is documented here in order to give you information about the
default behavior of an NSURLHandle created to deal with a URL
that has either the http
or https
scheme.
The name and/or other implementation details of this class
may be changed at any time.
A GSHTTPURLHandle instance is used to manage connections to
http
and https
URLs.
Secure connections are handled automatically
(using openSSL) for URLs with the scheme https
.
Connection via proxy server is supported, as is proxy tunneling
for secure connections. Basic parsing of http
headers is performed to extract http
status
information, cookies etc. Cookies are
retained and automatically sent during subsequent requests where
the cookie is valid.
Header information from the current page may be obtained using
-propertyForKey and -propertyForKeyIfAvailable. HTTP
status information can be retrieved as by calling either of these
methods specifying one of the following keys:
http
version supported by remote server
According to MacOS-X headers, the following should also be supported, but currently are not:
The omission of these headers is not viewed as important at present, since the MacOS-X public beta implementation doesn't work either.
Other calls to -propertyForKey and -propertyForKeyIfAvailable may
be made specifying a http
header field name.
For example specifying a key name of "Content-Length"
would return the value of the "Content-Length" header
field.
-writeProperty:forKey: can be used to specify the parameters
for the http
request. The default request uses the
"GET" method when fetching a page, and the
"POST" method when using -writeData:.
This can be over-ridden by calling -writeProperty:forKey: with
the key name "GSHTTPPropertyMethodKey" and specifying an
alternative method (i.e "PUT").
A Proxy may be specified by calling -writeProperty:forKey: with the keys "GSHTTPPropertyProxyHostKey" and "GSHTTPPropertyProxyPortKey" to set the host and port of the proxy server respectively. The GSHTTPPropertyProxyHostKey property can be set to either the IP address or the hostname of the proxy server. If an attempt is made to load a page via a secure connection when a proxy is specified, GSHTTPURLHandle will attempt to open an SSL Tunnel through the proxy.
http
version supported by remote server
http
headers and the corresponding header value (or nil if there
is none) is returned.
http
or https
request to the web server.
Returns YES on success,
NO on failure. By default, this method performs a POST operation.
On completion, the resource data for this handle is set to the
page returned by the request.
http
and 4430 for https
.