ArcGIS for Developers

NetworkRequestHeaders QML Type

Declares the header information for network requests. More...

Import Statement: import ArcGIS.AppFramework 1.0
Inherits:

PropertySet

Properties

Detailed Description

The NetworkRequestHeaders component handles the headers of network requests, containing and supplying basic information about a request. This component can only be instantiated by the NetworkRequest component.

The following code sample demonstrates usage of the properties supplied by NetworkRequestHeaders.

Item {
    function test_NetworkRequestHeaders_1_referer() {
        networkRequest.headers.referer="https://www.arcgis.com/home/index.html"
        compare(networkRequest.headers.referer,"https://www.arcgis.com/home/index.html")
        compare(networkRequest.headers.json.Referer,"https://www.arcgis.com/home/index.html")
    }

    function test_NetworkRequestHeaders_2_userAgent() {
        networkRequest.headers.userAgent = "Mozilla/5.0";
        compare(networkRequest.headers.userAgent,"Mozilla/5.0")
        }
}

Property Documentation

referer : string

Declares the referral address given to a web address. i.e., 'www.arcgis.com'. Has the same purpose as referrer.

This spelling error is a long-time programming standard. But because this is confusing, a lot of programmers and languages have also started including the correct spelling.


referrer : string

Declares the referral address given to a web address. i.e., 'www.arcgis.com'. Has the same purpose as referer.


userAgent : string

Declares the user agent given to a web address. A user agent is software acting on the behalf of a user, and in this case declares a web browser to the target web site.