Io Reference







Networking   /   Socket   /   URL





 
 
 



clear

Private method to clear the URL's parsed attributes.
escapeString(aString)

Returns a new String that is aString with the appropriate characters replaced by their URL escape codes.
fetch

Fetches the url and returns the result as a Sequence. Returns an Error, if one occurs.
fetchHttp(optionalProgressBlock)

Private method that fetches an http url.
fetchRaw

Fetch and return the entire response. Note: This may have problems for some request times.
fetchToFile(aFile)

Fetch the url and save the result to the specified File object. Saving is done as the data is read, which helps minimize memory usage. Returns self on success or nil on error.
fetchWithProgress(progressBlock)

Same as fetch, but with each read, progressBlock is called with the readBuffer and the content size as parameters.
headerBreaks

Private method to connect to the host and write the header.
openOnDesktop

Opens the URL in the local default browser. Supports OSX, Windows and (perhaps) other Unixes.
parse

Private method to parse the url.
post(parameters, headers)

Sends an HTTP post message. If parameters is a Map, its key/value pairs are send as the post parameters. If parameters is a Sequence or String, it is sent directly. Any headers in the headers map are sent with the request. Returns a sequence containing the response on success or an Error, if one occurs.
processHttpResponse(optionalProgressBlock)

Private method that processes http response.
referer

Returns the referer String or nil if not set.
requestHeader

Returns a Sequence containing the request header that will be sent.
setReferer(aString)

Sets the referer. Returns self.
setRequest(requestString)

Private method to set the url request.
setResponseHeaderString(headerString)

Private method that parses the responseHeaders.
setURL(urlString)

Sets the url string and parses into the protocol, host, port path, and query slots. Returns self.
stopFetch

Stops the fetch, if there is one. Returns self.
test

Private test method.
unescapeString(aString)

Returns a new String that is aString with the URL escape codes replaced by the appropriate characters.
url

Returns url string.
with(urlString)

Returns a new URL instance for the url in the urlString.