User Tools

Site Tools


cs326:lab4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cs326:lab4 [2021/09/30 01:57]
scarl [Part II. Exploring the HTTPoison library]
cs326:lab4 [2021/10/04 20:46]
scarl
Line 105: Line 105:
 Let's load up and explore the ''​HTTPoison''​ library. This library provides a set of modules and functions to query web resources programmatically. Edit **mix.exs**,​ by adding the following map to the list in ''​deps'':​ Let's load up and explore the ''​HTTPoison''​ library. This library provides a set of modules and functions to query web resources programmatically. Edit **mix.exs**,​ by adding the following map to the list in ''​deps'':​
  
- ''​{:​httpoison,​ "~> 1.0"}''​+<​code>​{:​httpoison,​ "~> 1.0"}</​code>​
  
 Save the file and run  Save the file and run 
Line 163: Line 163:
 Ask for a page on my classes website that probably doesn'​t exist. **Record** the webpage requested and the ''​status_code''​ you get. Ask for a page on my classes website that probably doesn'​t exist. **Record** the webpage requested and the ''​status_code''​ you get.
  
-Finally, try these. For the first two, **record** the ''​headers''​ list. For the next two, **record** the response. For the last two, **record** the first element of the response tuple and the ''​status_code''​ if it works.+Finally, try these. For the first two, **record** the ''​headers''​ list. For the rest, **record** the first element of the response tuple and the ''​status_code''​ if it works.
  
 <​code>​ <​code>​
cs326/lab4.txt ยท Last modified: 2021/10/04 20:46 by scarl