Teaching-Assistant:
Francois Picalausa (fpicalau@ulb.ac.be)
5 labs:
You are free to choose your tools to solve the exercises.
However, code skeletons and solutions are currently only provided in Java.
GET rfc5023 HTTP/1.1⏎ Host: tools.ietf.org⏎ User-Agent: Mozilla/5.0 (Windows ...⏎ Accept: text/html,...;q=0.9,*/*;q=0.8⏎ Accept-Language: en-us,en;q=0.5⏎ Accept-Encoding: gzip, deflate⏎ Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7⏎ Connection: keep-alive⏎ If-Modified-Since: Mon, 09 Jan 2012 22:47:46 GMT⏎ If-None-Match: "1827ba7-21df5-4b6202feb4880;4b6ff84c9e6cf"⏎ Cache-Control: max-age=0⏎ ⏎
HTTP/1.1 200 OK Date: Fri, 27 Jan 2012 00:46:12 GMT⏎ Server: Apache/2.2.21 (Debian)⏎ Content-Location: rfc5023.html⏎ Last-Modified: Mon, 09 Jan 2012 22:47:46 GMT⏎ Etag: "1827ba7-21df5-4b6202feb4880;4b777cde1187e"⏎ Accept-Ranges: bytes⏎ Content-Encoding: gzip⏎ Content-Length: 29741⏎ Keep-Alive: timeout=5, max=100⏎ Connection: Keep-Alive⏎ Content-Type: text/html; charset=latin-1⏎ ⏎ <!DOCTYPE html PUBLIC "-//W3C//DTD ...
Many tools can be used to send HTTP requests: firefox, curl, wget...
In this first part, we will use curl:
curl -v -X <Method> -H "<header>: <value>" http://...
We will implement a tool to fetch maps of given places
java MyMapTool "Atomium" /tmp/map.png
Yahoo! PlaceFinder and Bing Map Imagery are RPC-style services.
The APIs provide (cf. documentation):
String url = "http://www.example.org/map?place=Atomium"; Client client = new Client(); // GET the url ClientResponse response = client.resource(url).get(ClientResponse.class); //Get the data InputStream data = response.getEntityStream();
Google Documents can be accessed via a REST-style API.
In this API
Various libraries provide native access to this API. We will get insights on how these libraries use the REST API.
<feed xmlns="http://www.w3.org/2005/Atom" [...]> <id>https://[...]/full</id> <updated>2009-08-17T11:10:16.894Z</updated> <title>Available Documents - john.smith.example@gmail.com</title> <author> <name>John Smith</name> <email>john.smith.example@gmail.com</email> </author>
<link rel="alternate" type="text/html" href="https://docs.google.com"/> <link rel="http://[...]#resumable-create-media" type="application/atom+xml" href="https://[...]/create-session/default/private/full"/> <link rel="self" type="application/atom+xml" href="https://[...]/full/"/> <link rel="http://[...]/g/2005#post" type="application/atom+xml" href="https://[...]/full"/> <link rel="http://[...]/g/2005#batch" type="application/atom+xml" href="https://[...]/full/batch"/>
<entry xmlns:gd="http://[...]/g/2005" gd:etag="'HhJSFgpeRyt7ImBq'"> <id>https://docs.google.com/feeds/id/pdf%3A12345</id> <published>2009-04-09T18:23:09.035Z</published> <category scheme="http://[...]/g/2005/labels" term="http://[...]/g/2005/labels#starred" label="starred"/> <category scheme="http://[...]/g/2005#kind" term="http://schemas.google.com/docs/2007#pdf" label="pdf"/> <title>PDF's Title</title> <content type="application/pdf" src="..."/>
<link rel="alternate" type="text/html" href="https://docs.google.com/fileview?id=12345&hl=en"/> <link rel="self" type="application/atom+xml" href="https://[...]/full/pdf%3A12345"/> <link rel="edit" type="application/atom+xml" href="https://[...]/full/pdf%3A12345"/> <link rel="edit-media" type="application/pdf" href="https://docs.google.com/feeds/default/media/pdf%3A12345"/> <gd:resourceId>pdf:12345</gd:resourceId> <docs:writersCanInvite value="false"/> </entry> <entry> ... </entry> </feed>
The solution is online. If you are stuck, feel free to have a look at it!
Bing & Google requires an application key:
This key will be disabled after the lab. You can create one for yourself after that.
You also need a Google account to access Google Documents.
Table of Contents | t |
---|---|
Exposé | ESC |
Full screen slides | e |
Presenter View | p |
Source Files | s |
Slide Numbers | n |
Toggle screen blanking | b |
Show/hide slide context | c |
Notes | 2 |
Help | h |