Method HttpClient():setUserAgent() Foundation
Sets the user agent.
METHOD :setUserAgent( <cUserAgent> ) --> self
:setUserAgent() returns the object executing the method.
The method :setUserAgent() defines how the HTTP client object identifies itself as a user agent when making requests to the server. Some servers use the user agent string for making assumptions about the application requesting a resource, and may choose to serve different content based on this decision. In such a scenario, applications may use :setUserAgent() to be able to mimmick a certain application or browser behavior.
By default, HTTP client objects identify themselves using an id string containing the token "Xbase++", the major and minor product version and the operating system version as returned by the Os() function. This default value can be overriden with the :setUserAgent() method. The following is an example of a default user agent string:
The user agent specified to :setUserAgent()is stored in the "User-Agent" header element of the request message object assigned to the :httpRequestmember variable. This HTTP request object is used as the default for requests sent using the methods :send() and :sendAsync().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.