Fuego.Net : WebServer

The WebServer component is used to send HTTP requests to an HTTP server and capture the responses. It supports HTTP methods GET and POST.

The body of the HTTP response is available in the WebServer.response attribute (String).

Note: This component is superseded by the Fuego.NetX.AdvancedWebServer component, which provides better performance and more functionality like support for proxies and for more HTTP methods (like PUT and DELETE).

Example: Get Oracle's website home page and save it to a file.


getFrom(WebServer, url : "http://oracle.com", args : null)

binaryResponse = Binary(text: WebServer.response,
                        encoding: "UTF8")

BinaryFile.writeFromBinaryTo(data : binaryResponse,
                             name : "/tmp/oracle_index.html",
                           append : false)
Related reference
Fuego.NetX : AdvancedWebServer