Adobe® AIR® API Reference for HTML Developers
Home  |  Show Classes List |  Index  |  Appendixes

Language Reference only       
URLRequestDefaults 
3D:
Context3D
Context3DBlendFactor
Context3DClearMask
Context3DCompareMode
Context3DProgramType
Context3DRenderMode
Context3DStencilAction
Context3DTextureFormat
Context3DTriangleFace
Context3DVertexBufferFormat
CubeTexture
IndexBuffer3D
Program3D
Stage3D
Texture
VertexBuffer3D
Air.net:
ServiceMonitor
SocketMonitor
URLMonitor
Air.update:
ApplicationUpdater
ApplicationUpdaterUI
DownloadErrorEvent
StatusFileUpdateErrorEvent
StatusFileUpdateEvent
StatusUpdateErrorEvent
StatusUpdateEvent
UpdateEvent
Data:
EncryptedLocalStore
SQLCollationType
SQLColumnNameStyle
SQLColumnSchema
SQLConnection
SQLError
SQLErrorEvent
SQLErrorOperation
SQLEvent
SQLIndexSchema
SQLMode
SQLResult
SQLSchema
SQLSchemaResult
SQLStatement
SQLTableSchema
SQLTransactionLockType
SQLTriggerSchema
SQLUpdateEvent
SQLViewSchema
Desktop:
Clipboard
ClipboardFormats
ClipboardTransferMode
DockIcon
Icon
InteractiveIcon
NativeApplication
NativeProcess
NativeProcessStartupInfo
NotificationType
SystemTrayIcon
Display:
BitmapData
NativeMenu
NativeMenuItem
Screen
Stage
StageDisplayState
StageQuality
Events:
ActivityEvent
AsyncErrorEvent
BrowserInvokeEvent
DataEvent
DatagramSocketDataEvent
DNSResolverEvent
DRMAuthenticateEvent
DRMStatusEvent
ErrorEvent
Event
EventDispatcher
FileListEvent
HTTPStatusEvent
InvokeEvent
InvokeEventReason
IOErrorEvent
LocationChangeEvent
MouseEvent
NativeProcessExitEvent
NetDataEvent
NetMonitorEvent
NetStatusEvent
OutputProgressEvent
ProgressEvent
SampleDataEvent
SecurityErrorEvent
ServerSocketConnectEvent
StatusEvent
StorageVolumeChangeEvent
TimerEvent
UncaughtErrorEvent
UncaughtErrorEvents
File:
File
FileMode
FileStream
StorageVolume
StorageVolumeInfo
Functions:
trace()
generateRandomBytes()
navigateToURL()
sendToURL()
Geom:
Matrix
Point
Rectangle
Media:
AudioDecoder
AudioPlaybackMode
H264Level
H264Profile
H264VideoStreamSettings
ID3Info
InputMediaStream
Microphone
MicrophoneEnhancedMode
MicrophoneEnhancedOptions
Sound
SoundChannel
SoundCodec
SoundLoaderContext
SoundMixer
SoundTransform
VideoCodec
VideoStatus
VideoStreamSettings
Native window:
NativeWindow
NativeWindowBoundsEvent
NativeWindowDisplayState
NativeWindowDisplayStateEvent
NativeWindowInitOptions
NativeWindowRenderMode
NativeWindowResize
NativeWindowSystemChrome
NativeWindowType
Net:
AAAARecord
ARecord
CertificateStatus
DatagramSocket
DNSResolver
FileFilter
InterfaceAddress
IPVersion
LocalConnection
MXRecord
NetConnection
NetMonitor
NetStreamAppendBytesAction
NetStreamMulticastInfo
NetworkInfo
NetworkInterface
ObjectEncoding
PTRRecord
ResourceRecord
Responder
SecureSocket
ServerSocket
SharedObject
SharedObjectFlushStatus
Socket
SRVRecord
URLLoader
URLLoaderDataFormat
URLRequest
URLRequestDefaults
URLRequestHeader
URLRequestMethod
URLStream
URLVariables
XMLSocket
Security:
ReferencesValidationSetting
RevocationCheckSettings
SignatureStatus
SignerTrustSettings
X500DistinguishedName
X509Certificate
XMLSignatureValidator
System:
Capabilities
Security
System
Updater
Ui:
Keyboard
KeyboardType
KeyLocation
Mouse
MouseCursorData
Utils:
Vector
ByteArray
Collator
CollatorMode
CompressionAlgorithm
CurrencyFormatter
CurrencyParseResult
DateTimeFormatter
DateTimeNameContext
DateTimeNameStyle
DateTimeStyle
Endian
HTMLLoader
HTMLPDFCapability
LastOperationStatus
LocaleID
NationalDigitsType
NumberFormatter
NumberParseResult
StringTools
Timer
window.runtime propertywindow.runtime.flash.net.URLRequestDefaults
InheritanceURLRequestDefaults Inheritance Object

Runtime Versions:  1.0

The URLRequestDefaults class includes static properties that you can set to define default values for the properties of the URLRequest class. It also includes a static method, URLRequestDefaults.setLoginCredentialsForHost(), 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 Adobe® 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.

See also



Properties
 PropertyDefined By
  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
  idleTimeout : Number
[static] The default setting for the idleTimeout property of URLRequest objects and HTMLLoader 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
Public Methods
 MethodDefined By
 Inherited
hasOwnProperty(name:String):Boolean
Indicates whether an object has a specified property defined.
Object
 Inherited
isPrototypeOf(theClass:Object):Boolean
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
propertyIsEnumerable(name:String):Boolean
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
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
toLocaleString():String
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
toString():String
Returns the string representation of the specified object.
Object
 Inherited
valueOf():Object
Returns the primitive value of the specified object.
Object
Property Detail

authenticate

property
authenticate:Boolean

Runtime Versions:  1.0

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.

The default value is true.


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

See also

cacheResponse

property 
cacheResponse:Boolean

Runtime Versions:  1.0

The default setting for the cacheResponse property of URLRequest objects. Setting the cacheResponse property in a URLRequest object overrides this default setting. When set to true, the default behavior for the AIR application is to use the operating system's HTTP cache. This setting does not apply to URLRequest objects used in file upload or RTMP requests.

The default value is true.


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

See also

followRedirects

property 
followRedirects:Boolean

Runtime Versions:  1.0

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.

The default value is true.


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

See also

idleTimeout

property 
idleTimeout:Number

Runtime Versions:  2

The default setting for the idleTimeout property of URLRequest objects and HTMLLoader objects.

The idle timeout is the amount of time (in milliseconds) that the client waits for a response from the server, after the connection is established, before abandoning the request.

This defines the default idle timeout used by the URLRequest or HTMLLoader object. Setting the idleTimeout property in a URLRequest object or an HTMLLoader object overrides this default setting.

When this property is set to 0 (the default), the runtime uses the default idle timeout value defined by the operating system. The default idle timeout value varies between operating systems (such as Mac OS, Linux, or Windows) and between operating system versions.

This setting does not apply to URLRequest objects used in file upload or RTMP requests.

The default value is 0.


Throws
SecurityError — The caller is not in the AIR application security sandbox.
 
RangeError — The idleTimeout value is negative.

See also

manageCookies

property 
manageCookies:Boolean

Runtime Versions:  1.0

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.

The default value is true.


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

See also

useCache

property 
useCache:Boolean

Runtime Versions:  1.0

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.

The default value is true.


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

See also

userAgent

property 
userAgent:String

Runtime Versions:  1.0

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.

This default value varies depending on the runtime operating system (such as Mac OS, Linux or Windows), the runtime language, and the runtime version, as in the following examples:

  • "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"
  • "Mozilla/5.0 (Windows; U; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"
  • "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"


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

See also

Method Detail

setLoginCredentialsForHost

()method
public function setLoginCredentialsForHost(hostname:String, user:String, password:String):*

Runtime Versions:  1.0

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.

Note for applications running on Mac OS: On Mac OS, 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.

Parameters

hostname:String — The host name to which the user name and password are applied. This can be a domain, such as "www.example.com" or a domain and a port number, such as "www.example.com:80". Note that "example.com", "www.example.com", and "sales.example.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.

Returns
*

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