REST, JSON, and APIs 10 试题 1. Who is credited with getting the JSON movement started? Pooja Sankar Mitchell Baker Douglas Crockford Bjarne Stroustrup 2. What Python library do you have to import to parse and handle JSON? ElementTree BeautifulSoup import re import json 3. What is the method used to parse a string containing JSON data so that you can work with the data in Python? json.read() json.connect() json.loads() json.parse() 4. What kind of variable will you get in Python when the following JSON is parsed: [ "Glenn", "Sally", "Jen" ] A list with three items A dictionary with three key / value pairs A dictionary with one key / value pair Three tuples One Tuple 5. Which of the following is not true about the service-oriented approach? Web services and APIs are used to transfer data between applications Standards are developed where many pairs of applications must work together An application makes use of the services provided by other applications An application runs together all in one place 6. Which of these two web service approaches is preferred in most modern service-oriented applications? REST - Representational state transfer SOAP - Simple Object Access Protocol 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.encode() re.match() urllib.urlencode() urllib.urlcat() 8. What happens when you exceed the Google geocoding API rate limit? The API starts to perform very slowly Your application starts to perform very slowly You canot use the API until you respond to an email that contains a survey question You cannot use the API for 24 hours 9. What protocol does Twitter use to protect its API? OAuth WS*Security PKI-HMAC Java Web Tokens SOAP SHA1-MD5 10. What header does Twitter use to tell you how many more API requests you can make before you will be rate limited? content-type x-max-requests x-rate-limit-remaining x-request-count-down