Pacoteflash.net
Classepublic class URLRequestDefaults
HerançaURLRequestDefaults Inheritance Object

The URLRequestDefaults class includes static properties which you can set to define default values for the properties of the URLRequest class. It also includes a static method, URLRequestDefaults.setLoginCredentials(), which lets you define default authentication credentials for requests. The URLRequest class defines the information to use in an HTTP request.

Any properties set in a URLRequest object override those static properties set for the URLRequestDefaults class.

URLRequestDefault settings only apply to content in the caller's application domain, with one exception: settings made by calling URLRequestDefaults.setLoginCredentialsForHost() apply to all application domains in the currently running application.

Only AIR content running in the application security sandbox can use the URLRequestDefaults class. Other content will result in a SecurityError being thrown when accessing the members or properties of this class.

Veja também

URLRequest


Propriedades Públicas
 PropriedadeDefinido por
  authenticate : Boolean
[static] The default setting for the authenticate property of URLRequest objects.
URLRequestDefaults
  cacheResponse : Boolean
[static] The default setting for the cacheResponse property of URLRequest objects.
URLRequestDefaults
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  followRedirects : Boolean
[static] The default setting for the followRedirects property of URLRequest objects.
URLRequestDefaults
  manageCookies : Boolean
[static] The default setting for the manageCookies property of URLRequest objects.
URLRequestDefaults
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  useCache : Boolean
[static] The default setting for the useCache property of URLRequest objects.
URLRequestDefaults
  userAgent : String
[static] The default setting for the userAgent property of URLRequest objects.
URLRequestDefaults
Métodos Públicos
 MétodoDefinido por
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
setLoginCredentialsForHost(hostname:String, user:String, password:String):*
[static] Sets default user and password credentials for a selected host.
URLRequestDefaults
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Detalhes da propriedade
authenticatepropriedade
authenticate:Boolean  [read-write]

The default setting for the authenticate property of URLRequest objects. Setting the authenticate property in a URLRequest object overrides this default setting.

Note: This setting does not apply to URLRequest objects used in file upload or RTMP requests, or used in the load() method of an HTMLLoader object.


Implementação
    public static function get authenticate():Boolean
    public function set authenticate(value:Boolean):void

Throws
SecurityError — The caller is not in the AIR application security sandbox.

The default value is true.

Veja também

cacheResponsepropriedade 
cacheResponse:Boolean  [read-write]

The default setting for the cacheResponse property of URLRequest objects. Setting the cacheResponse property in a URLRequest object overrides this default setting. This setting does not apply to URLRequest objects used in file upload or RTMP requests, or used in the load() method of an HTMLLoader object.

The default value is true.


Implementação
    public static function get cacheResponse():Boolean
    public function set cacheResponse(value:Boolean):void

Throws
SecurityError — The caller is not in the AIR application security sandbox.

Veja também

followRedirectspropriedade 
followRedirects:Boolean  [read-write]

The default setting for the followRedirects property of URLRequest objects. Setting the followRedirects property in a URLRequest object overrides this default setting. This setting does not apply to URLRequest objects used in file upload or RTMP requests, or used in the load() method of an HTMLLoader object.

The default value is true.


Implementação
    public static function get followRedirects():Boolean
    public function set followRedirects(value:Boolean):void

Throws
SecurityError — The caller is not in the AIR application security sandbox.

Veja também

manageCookiespropriedade 
manageCookies:Boolean  [read-write]

The default setting for the manageCookies property of URLRequest objects. Setting the manageCookies property in a URLRequest object overrides this default setting.

Note: This setting does not apply to URLRequest objects used in file upload or RTMP requests, or used in the load() method of an HTMLLoader object.

The default value is true.


Implementação
    public static function get manageCookies():Boolean
    public function set manageCookies(value:Boolean):void

Throws
SecurityError — The caller is not in the AIR application security sandbox.

Veja também

useCachepropriedade 
useCache:Boolean  [read-write]

The default setting for the useCache property of URLRequest objects. Setting the useCache property in a URLRequest object overrides this default setting. This setting does not apply to URLRequest objects used in file upload or RTMP requests, or used in the load() method of an HTMLLoader object.

The default value is true.


Implementação
    public static function get useCache():Boolean
    public function set useCache(value:Boolean):void

Throws
SecurityError — The caller is not in the AIR application security sandbox.

Veja também

userAgentpropriedade 
userAgent:String  [read-write]

The default setting for the userAgent property of URLRequest objects. Setting the userAgent property in a URLRequest object overrides this default setting.

This is also the default user agent string for all HTMLLoader objects (used when you call the load() method of the HTMLLoader object). Setting the userAgent property of the HTMLLoader object overrides the URLRequestDefaults.userAgent setting.


Implementação
    public static function get userAgent():String
    public function set userAgent(value:String):void

Throws
SecurityError — The caller is not in the AIR application security sandbox.

Veja também

Detalhes do método
setLoginCredentialsForHost()método
public static function setLoginCredentialsForHost(hostname:String, user:String, password:String):*

Sets default user and password credentials for a selected host. These settings apply for URLRequest objects in all application domains of the application, not only those in the application domain of the object calling this method. (Whereas the static properties of the URLRequest class apply to the caller's application domain only.) This allows content in the entire application (regardless of the content's application domain) to be logged in when another part of the application logs in.

Any properties set in the setLoginCredentials() method of a URLRequest object override settings made in a call to URLRequestDefaults.setLoginCredentialsForHost().

Note for applications running on MacOS: On MacOS, when you call this method, the application uses these credentials for the specified host until the application is closed, even if you subsequently call URLRequestDefaults.setLoginCredentialsForHost() for the same host. However, if a server rejects the credentials specified by this method, then a subsequent call to the URLRequestDefaults.setLoginCredentialsForHost() method (for the same host) will be recognized.

Note: This method does not apply to URLRequest objects used in file upload or RTMP requests.

Parâmetros

hostname:String — The host name to which the user name and password are applied. This can be a domain, such as "www.exemplo.com" or a domain and a port number, such as "www.exemplo.com:80". Note that "exemplo.com", "www.exemplo.com", and "sales.exemplo.com" are each considered unique hosts.
 
user:String — The default user name to use in request authentication for the specified host.
 
password:String — The default password to use in request authentication for the specified host.

Retorna
*

Throws
SecurityError — The caller is not in the AIR application security sandbox.

Veja também