HttpUserAgent APIs

The HttpUserAgent object provides APIs to manage the HTTP-specific user agent.

All API specifications use the HttpUserAgent object that is assumed to be defined by the urlopen.httpUserAgent() class constructor.

HttpUserAgent.prototype.get()

Returns a specific property value of the HttpUserAgent object or returns the HttpUserAgent object.

Syntax
HttpUserAgent.prototype.get([name])
Parameters
name
The property name in the HttpUserAgent object. The valid properties are defined in the ua_options parameter of the urlopen.HttpUserAgent() API.
Guidelines
When you specify the property name, the property value is returned. Otherwise, the HttpUserAgent object is returned. When you specify an invalid property name, undefined is returned.

HttpUserAgent.prototype.set()

Configures a specific property of the HttpUserAgent object.

Syntax
HttpUserAgent.prototype.set(name,value)
HttpUserAgent.prototype.set({name:value})
Parameters
name
The property name in the HttpUserAgent object. The valid properties are defined in the ua_options parameter of the urlopen.HttpUserAgent() API.
value
The value to assign to the property.
Guidelines