URL and HTTP• URL  – http://www.nyc.gov/html/doh/html/rii/index.shtml  – Is limited in what characters can be used – a bla...
HTTP Response• This is the response that our http request  receives back from the web server (or host)• Status – a numeric...
HTML / XML• Encoding information on a webpage• <b>This is bolded</b>• <a href=“www.uky.edu”>A link to UK’s  webpage</a>  –...
Forms…
Get vs. Put• GET encodes the data entered by a user from  a webform in the URL• POST passes the data entered by a user as ...
GEThttp://qpublic7.qpublic.net/ky_fayette_subdivison.php?searchType=form&subNumber=&subName=&sectionValue=&townshipValue=&...
PUThttp://a816-restaurantinspection.nyc.gov/RestaurantInspection/SearchResults.do
A note about libraries• Libraries are bits of pre-written code that  make common tasks easier• But you have to load them b...
Upcoming SlideShare
Loading in …5
×

Url and http

592 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Url and http

  1. 1. URL and HTTP• URL – http://www.nyc.gov/html/doh/html/rii/index.shtml – Is limited in what characters can be used – a black space “ “ is represented by %20 in a URL• HTTP - how resources are “fetched” on the web• HTTP Request – Request line (method = GET or PUT; path) – Header (primarily referencing the host) – Body (passing variables/selections; used in PUT)
  2. 2. HTTP Response• This is the response that our http request receives back from the web server (or host)• Status – a numeric status (“404 code”)• Headers – indication of what kind of content• Body – the web page that is displayed – HTML content, javascript, etc.
  3. 3. HTML / XML• Encoding information on a webpage• <b>This is bolded</b>• <a href=“www.uky.edu”>A link to UK’s webpage</a> – Open and close tags – Sets up patterns that can be parsed
  4. 4. Forms…
  5. 5. Get vs. Put• GET encodes the data entered by a user from a webform in the URL• POST passes the data entered by a user as a set of variables. – Much hard to see
  6. 6. GEThttp://qpublic7.qpublic.net/ky_fayette_subdivison.php?searchType=form&subNumber=&subName=&sectionValue=&townshipValue=&rangeValue=&startDate=12-01-2011&endDate=12-31-2011&startPrice=&endPrice=&startArea=&endArea=&startAcreage=&endAcreage=&startYrblt=&endYrblt=&startAssd=&endAssd=&saleVacant=All&stories=All&propertyType=All&streetNumber=&streetName=&county=ky_fayette&slevel=fayette_advanced&start=0&excel_start=0&SUBMIT=Start+Query
  7. 7. PUThttp://a816-restaurantinspection.nyc.gov/RestaurantInspection/SearchResults.do
  8. 8. A note about libraries• Libraries are bits of pre-written code that make common tasks easier• But you have to load them before you run you code – gem install nokigiri (useful for parsing XML docs) • Alternatively one could use regular expressions – gem install httparty (useful for building http queries)

×