REST, JSON, and APIs >> Using Python to Access Web Data

REST, JSON, and APIs >> Using Python to Access Web Data


1. Who is credited with getting the JSON movement started?

  • Mitchell Baker
  • Douglas Crockford
  • Pooja Sankar
  • Bjarne Stroustrup

2. What Python library do you have to import to parse and handle JSON?

  • BeautifulSoup
  • import re
  • ElementTree
  • import json

3. Which of the following is a web services approach used by the Twitter API?

  • CORBA
  • REST
  • SOAP
  • XML-RPC

4. What kind of variable will you get in Python when the following JSON is parsed:

{ "id" : "001",
"x" : "2",
"name" : "Chuck"
}
  • A list with three items
  • A list with six items
  • A tuple with three items
  • A list of tuples
  • A dictionary with three key / value pairs

5. Which of the following is not true about the service-oriented approach?

  • An application runs together all in one place
  • Web services and APIs are used to transfer data between applications
  • An application makes use of the services provided by other applications
  • Standards are developed where many pairs of applications must work together

6. Which of these two web service approaches is preferred in most modern service-oriented applications?

  • SOAP – Simple Object Access Protocol
  • REST – Representational state transfer

7. What library call do you make to append properly encoded parameters to the end of a URL like the following:

http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Ann+Arbor%2C+MI
  • re.match()
  • urllib.parse.urlencode()
  • re.encode()
  • urllib.urlcat()

8. What happens when you exceed the Google geocoding API rate limit?

  • The API starts to perform very slowly
  • You canot use the API until you respond to an email that contains a survey question
  • Your application starts to perform very slowly
  • You cannot use the API for 24 hours

9. What protocol does Twitter use to protect its API?

  • PKI-HMAC
  • Java Web Tokens
  • WS*Security
  • OAuth
  • SHA1-MD5
  • SOAP

10. What header does Twitter use to tell you how many more API requests you can make before you will be rate limited?

  • x-max-requests
  • content-type
  • x-request-count-down
  • x-rate-limit-remaining

Leave a Comment