From 7464f4abcff16e478f6c10d8b0d1802b04250cf3 Mon Sep 17 00:00:00 2001 From: fyodor Date: Fri, 1 Feb 2008 20:58:32 +0000 Subject: [PATCH] add nse http library docs from Sven --- docs/scripting.xml | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/docs/scripting.xml b/docs/scripting.xml index de43ae1f2..c88d73591 100644 --- a/docs/scripting.xml +++ b/docs/scripting.xml @@ -1332,6 +1332,74 @@ if(s) code_to_be_done_on_match end + + HTTP Functions + + The http module provides functions for dealing with the client side of the http protocol. + The functions reside inside the http namespace. + The return value of each function in this module is a table with the following keys: + status, header and body. + status is the status code of the http request + In case of an error status is nil. header + is a table with the headers received from the server. The header names are + lower-cased and multiple headers of the same name are concatenated with comma. + body holds a string with the request body. + + + + + get + + + Fetches a resource with a GET request. + The first argument is either a string with the hostname or a + table like the host table passed by nmap. The second argument + is either the port number or a table like the port table passed + by nmap. The third argument is the path of the resource. The fourth + argument is a table for further options. The table may have 2 keys: + timeout and header. + timeout is the timeout used for the socket + operations. header is a table with additional + headers to be used for the request. + The function builds the request and calls http.request + + + + + + request + + + Sends request to host:port + and parses the answer. + The first argument is either a string with the hostname or a + table like the host table passed by nmap. The second argument + is either the port number or a table like the port table passed + by nmap. SSL is used for the request if either port.service + equals "https" or port.version.service_tunnel + equals "ssl". The third argument is the request. The fourth + argument is a table for further options. You can specify a timeout + for the socket operations with the timeout key. + + + + + + get_url + + + Parses url and calls http.get + with the result. + The second argument is a table for further options. The table may have 2 keys: + timeout and header. + timeout is the timeout used for the socket + operations. header is a table with additional + headers to be used for the request. + + + + + Various Utility Functions