1 / 12

IST256 : Applications Programming for Information Systems

Learn about HTTP protocol, Web APIs, and practice activities including coding demos of various APIs. Gain practical skills in working with JSON data and accessing different web services efficiently.

lewise
Download Presentation

IST256 : Applications Programming for Information Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IST256 : Applications Programming for Information Systems The HTTP Protocol and Web Services

  2. Agenda • Connection Activity • Attendance • Teaching: • HTTP • Web Services • Practice Activities (3) • Thursday

  3. Connect Activity • https://goo.gl/TJOuaW • Sign in with your NetID and Password • Enter Today’s PIN 9901

  4. HTTP The Protocol of The Web • When you type a URL into your browser you’re making a request. • The site processing your request sends a response. • Part of the response is the status code. This indicates “what happened” • The other part of the response is content(HTML) which is rendered by the browser. • HTTP is a text based protocol.

  5. Watch Me Code A Non-Python Demo of HTTP • What happens when you request a site? Like syr.edu?

  6. What is a Web API? • An API is short for Application Programming Interface. • A Web API uses HTTP Protocolto communicate with your program. • Web API’s can return data in many formats. We’ll focus on the JSON (JavaScript Object Notation) format which converts easily to Python listsand dictionaries.

  7. Watch Me Code Google’s Geocoding API • Get a GPS coordinate (Latitude and Longitude) for a City or Street Address • HTTP GET: http://maps.googleapis.com/maps/api/geocode/json?address=addr

  8. Web API: Weather Forecasting • https://darksky.net/dev • Darksky.net / Forecast IO • Sign up for an API key • 1000 free requests / day

  9. Watch Me Code Let’s Continue Our Geocode Example: • Get Current weather for Lat/Lng • Refactor as a function • Write a program to ask for a location, show current conditions for location!

  10. Other Web API’s • https://itunes.apple.com/search?term - iTunes Search • https://swapi.co/ - Star Wars API • https://www.omdbapi.com/ - Movie Database API • http://www.pokeapi.co/ - Pokemon API • http://open-notify.org/ - Space API • http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php- Earthquake API

  11. Help me Code Let’s write a program to ask you for a sub-Reddit and then print the titles of the top stories in that sub-Reddit Example API Call: (news) sub-Reddit https://www.reddit.com/r/news/top.json • First we get it to work with this url • Then let’s write the full program

  12. Conclusion Activity Your “Ticket Out” • http://bit.ly/2eBCPM7 • The activity will be effort graded.

More Related