Successfully reported this slideshow.
Your SlideShare is downloading. ×

Url and http

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 8 Ad

More Related Content

Similar to Url and http (20)

Advertisement

Recently uploaded (20)

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. GET http://qpublic7.qpublic.net/ky_fayette_subdivison.php?searchType=form&subNumber=&subName=&sec tionValue=&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. PUT http://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)

×