-
Notifications
You must be signed in to change notification settings - Fork 2
File I O and Web Requests
The loadFile
function takes a string as an argument, uses it as the filename, and returns a 'file' datatype as an output.
The saveFile
takes a 'file' datatype as an argument, looks up the file, and saves the file using it's filename. It returns the 'file' that it took as input.
The get
request function takes a string as an argument, uses it as the domain name, and all arguments afterwards are headers. It returns a 'website' datatype, which includes a domain name, headers, and file contents.
The post
request function takes a string as an argument, uses it as the domain name, and all arguments afterwards are used as elements of the post request. It returns a 'website' datatype, just like get requests.
Effectively, this functions the same way as the post
request function, but it takes a tree as the second argument, and uses that as the values of the form.