Making HTTP requests and parsing the response with Python

There are a number of Python modules that you can use to make REST requests. There are really too many! Modules include urllib2, httplib2, pycurl, and requests. requests is definitely the best of the bunch in my opinion. It is cleaner and easier to use for repeated interaction with RESTful APIs. Once you've made the request, you can then parse the JSON response with the Python json module. In this recipe, you will learn how to do this.

Getting ready

The Python requests module can be used to submit requests to an ArcGIS Server resource and process the returned response. Follow these steps to learn the basic steps involved in submitting requests and processing the response using the requests ...

Get Programming ArcGIS with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.