I am using the following url to generate route task . https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route
This is the sample URL, I have tried this URL also https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World
I am getting the same error with both URL. The code that I am following is same as the one mentioned in the sample codes.
Please let me know what am I doing wrong.