How to determine if any gis service is secured or unsecured at the REST end point. I want to hit the arcgis server REST using Python and find if services are secured or not.
Hi Shikhar,
Case 1:
If the services that you are accessing are known to you , you will probably know the services that are published.
So , you can query them using urllib/ urllib2 like :
import urllib2 url = "http://YourUrl/rest/services/sample/MapServer/0/query?where=1%3D1&f=pjson" data = urllib2.urlopen(url).read() print data
If you are getting results , then it is not secured.
If you are getting result as '{\n "error": {\n "code": 499,\n "message": "Token Required",\n "details": []\n }\n}' , or any such error , then it is secured.
Case 2:
If the services that you are accessing is not known to you and you can do a simple analysis using the following URL: http://YourURL/rest/services/?f=pjson
and conclude if the services are secure or not secure.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.