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.
APIs for the
HttpUserAgent object.
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_optionsparameter 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,
undefinedis returned.
HttpUserAgent.prototype.set()
Configures a specific property of the HttpUserAgent object.
- Syntax
HttpUserAgent.prototype.set(name,value)- Parameters
-
- name
- The property name in the HttpUserAgent object. The valid properties are
defined in the
ua_optionsparameter of the urlopen.HttpUserAgent() API. - value
- The value to assign to the property.
- Guidelines