| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in Mac OS X v10.2 with Safari 1.0 installed. Available in Mac OS X v10.2.7 and later. |
| Companion guide | |
| Declared in | NSURLProtectionSpace.h |
NSURLProtectionSpace represents a server or an area on a server, commonly referred to as a realm, that requires authentication. An NSURLProtectionSpace’s credentials apply to any requests within that protection space.
– initWithHost:port:protocol:realm:authenticationMethod:
– initWithProxyHost:port:type:realm:authenticationMethod:
– authenticationMethod
– host
– isProxy
– port
– protocol
– proxyType
– realm
– receivesCredentialSecurely
Returns the authentication method used by the receiver.
- (NSString *)authenticationMethod
The authentication method used by the receiver. The supported authentication methods are listed in “Constants.”
NSURLProtectionSpace.hReturns the receiver’s host.
- (NSString *)host
The receiver's host.
NSURLProtectionSpace.hInitializes a protection space object.
- (id)initWithHost:(NSString *)host port:(NSInteger)port protocol:(NSString *)protocol realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod
The host name for the protection space object.
The port for the protection space object. If port is 0 the default port for the specified protocol is used, for example, port 80 for HTTP. Note that servers can, and do, treat these values differently.
The protocol for the protection space object. The value of protocol is equivalent to the scheme for a URL in the protection space, for example, “http”, “https”, “ftp”, etc.
A string indicating a protocol specific subdivision of the host. realm may be nil if there is no specified realm or if the protocol doesn’t support realms.
The type of authentication to use. authenticationMethod should be set to one of the values in “Constants” or nil to use the default, NSURLAuthenticationMethodDefault.
NSURLProtectionSpace.hInitializes a protection space object representing a proxy server.
- (id)initWithProxyHost:(NSString *)host port:(NSInteger)port type:(NSString *)proxyType realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod
The host of the proxy server for the protection space object.
The port for the protection space object. If port is 0 the default port for the specified proxy type is used, for example, port 80 for HTTP. Note that servers can, and do, treat these values differently.
The type of proxy server. The value of proxyType should be set to one of the values specified in “Constants.”
A string indicating a protocol specific subdivision of the host. realm may be nil if there is no specified realm or if the protocol doesn’t support realms.
The type of authentication to use. authenticationMethod should be set to one of the values in “Constants” or nil to use the default, NSURLAuthenticationMethodDefault.
NSURLProtectionSpace.hReturns whether the receiver represents a proxy server.
- (BOOL)isProxy
YES if the receiver represents a proxy server, NO otherwise.
NSURLProtectionSpace.hReturns the receiver’s port.
- (NSInteger)port
The receiver's port.
NSURLProtectionSpace.hReturns the receiver’s protocol.
- (NSString *)protocol
The receiver's protocol, or nil if the receiver represents a proxy protection space.
NSURLProtectionSpace.hReturns the receiver's proxy type.
- (NSString *)proxyType
The receiver's proxy type, or nil if the receiver does not represent a proxy protection space. The supported proxy types are listed in “Constants.”
NSURLProtectionSpace.hReturns the receiver’s authentication realm
- (NSString *)realm
The receiver’s authentication realm, or nil if no realm has been set.
A realm is generally only specified for HTTP and HTTPS authentication.
NSURLProtectionSpace.hReturns whether the credentials for the protection space can be sent securely.
- (BOOL)receivesCredentialSecurely
YES if the credentials for the protection space represented by the receiver can be sent securely, NO otherwise.
NSURLProtectionSpace.hThese constants describe the supported proxy types used in initWithProxyHost:port:type:realm:authenticationMethod: and returned by proxyType.
extern NSString *NSURLProtectionSpaceHTTPProxy; extern NSString *NSURLProtectionSpaceHTTPSProxy; extern NSString *NSURLProtectionSpaceFTPProxy; extern NSString *NSURLProtectionSpaceSOCKSProxy;
NSURLProtectionSpaceHTTPProxyThe proxy type for HTTP proxies.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLProtectionSpaceHTTPSProxyThe proxy type for HTTPS proxies.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLProtectionSpaceFTPProxyThe proxy type for FTP proxies.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLProtectionSpaceSOCKSProxyThe proxy type for SOCKS proxies.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLProtectionSpace.hThese constants describe the available authentication methods used in initWithHost:port:protocol:realm:authenticationMethod:, initWithProxyHost:port:type:realm:authenticationMethod: and returned by authenticationMethod.
extern NSString *NSURLAuthenticationMethodDefault; extern NSString *NSURLAuthenticationMethodHTTPBasic; extern NSString *NSURLAuthenticationMethodHTTPDigest; extern NSString *NSURLAuthenticationMethodHTMLForm;
NSURLAuthenticationMethodDefaultUse the default authentication method for a protocol.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLAuthenticationMethodHTTPBasicUse HTTP basic authentication for this protection space.
This is equivalent to NSURLAuthenticationMethodDefault for HTTP.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLAuthenticationMethodHTTPDigestUse HTTP digest authentication for this protection space.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLAuthenticationMethodHTMLFormUse HTML form authentication for this protection space.
This authentication method can apply to any protocol.
Available in Mac OS X v10.2 and later.
Declared in NSURLProtectionSpace.h.
NSURLProtectionSpace.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)