Commits

gustafn  committed fb1cbbd

- updated documentation (ns_http and friends)
- marked ns_httpget, ns_httppost and ns_httpopen as depreacted (use ns_http instead)

  • Participants
  • Parent commits 49967a3

Comments (0)

Files changed (5)

File doc/src/naviserver/ns_http.man

 
 [list_begin definitions]
 
-[call [cmd ns_http] [arg cancel] [arg id]]
+[call [cmd "ns_http cancel"] \
+	[arg id]]
 
-Cancel quueued http request by id
+Cancel queued http request by id (ns_set id of request).
 
-[call [cmd ns_http] [arg cleanup]]
+[call [cmd "ns_http cleanup"]]
 
 Cancel all pending http requests
 
-[call [cmd ns_http] [arg list]]
+[call [cmd "ns_http list"]]
 
 Return the list of currently running or pending requests in format:
 id url done|running ....
 
-[call [cmd ns_http] [arg queue] [opt [arg {-method M}]] [opt [arg {-body B}]] [opt [arg {-headers S}]] [opt [arg {-timeout T}]]]
-
-[arg -timeout]
-Timeout for how long to wait reply back from the web server
+[call [cmd "ns_http queue"] \
+	[opt [arg {-method M}]] \
+	[opt [arg {-headers S}]] \
+	[opt [arg {-body B}]] \
+	[opt [arg {-timeout T}]]]
 
 [arg -method]
-GET or POST or HEAD
-
-[arg -body]
-body is the value which will be sent as the HTTP request body.
+use the specified HTTP method such as GET or POST or HEAD
 
 [para]
 [arg -headers]
 headers is the ns_set ID containing the additional headers to include in the HTTP request.
 
-[call [cmd ns_http] [arg wait] [opt [arg {-result var}]] [opt [arg {-status var}]] [opt [arg {-timeout t}]] [opt [arg {-headers H}]] [opt [arg {-elapsed var}]]]
+[arg -body]
+body is the value which will be sent as the HTTP request body.
+
+[arg -timeout]
+Timeout for how long to wait reply back from the web server
+
+[para]
+The command [cmd "ns_http queue"] returns the ns_set ID of the HTTP
+request, which might be used later for waiting for this request or
+canceling this request.
+
+
+[call [cmd "ns_http run"] \
+	[opt [arg {-method M}]] \
+	[opt [arg {-headers S}]] \
+	[opt [arg {-body B}]] \
+	[opt [arg {-timeout T}]]]
+
+[para] 
+Send a HTTP reuqest and wait for the result.  The command 
+[cmd "ns_http run"] is similar to [cmd "ns_http queue"] followed by 
+[cmd "ns_http wait"].
+
+
+[call [cmd "ns_http wait"] \
+	[opt [arg {-result var}]] \
+	[opt [arg {-status var}]] \
+	[opt [arg {-timeout t}]] \
+	[opt [arg {-headers H}]] \
+	[opt [arg {-elapsed var}]] \
+	[arg id]]
 
 [arg -elapsed]
 var is the name of a variable that should be used to store the elapsed time for the request from beginning to finish
 [arg -headers]
 headers is the ns_set ID which will receive the headers from the HTTP response.
 
+[para]
+[arg id]
+ns_set ID of the HTTP request to wait for.
+
 [list_end]
 
 [section EXAMPLES]
 [example_end]
 
 
-[see_also nsd]
-[keywords ns_httpopen]
+[see_also ns_ssl ns_httpget ns_httppost ns_httptime]
+[keywords http-client] 
 
 [manpage_end]
 

File doc/src/naviserver/ns_httpget.man

 [titledesc {Open an HTTP connection and fetch a page}]
 
 [description]
+This command is deprecated; use [cmd ns_http] instead.
+[para]
 ns_httpget opens an HTTP connection and fetches the page at the specified url.
 You can specify a timeout for opening the connection (the default is 30 seconds),
  and a maximum level of redirection (the default is 0). ns_httpget sends the 
 set page [lb]ns_httpget http://www.aolserver.com[rb]
 [example_end]
 
+[see_also ns_http ns_httppost ns_httpopen ns_httptime]
+[keywords http-client] 
+
 [manpage_end]
 

File doc/src/naviserver/ns_httpopen.man

 [titledesc {Fetch a web page}]
 
 [description]
-
+This command is deprecated; use [cmd ns_http] instead.
+[para]
 This command opens an http connection to a web page used to fetch its contents
 via the method, which may be POST, GET, or another valid http method.  If the
 act of opening the connections fails, it may throw an error.
 [example_end]
 
 
-[see_also nsd]
-[keywords ns_http ns_httpget ns_httppost]
+[see_also ns_http ns_httpget ns_httppost ns_httptime]
+[keywords http-client] 
 
 [manpage_end]
 

File doc/src/naviserver/ns_httppost.man

 [titledesc {Open an HTTP connection and posts data to the server}]
 
 [description]
-ns_httppost is a wrapper around ns_httpopen to send data using HTTP POST method.
+This command is deprecated; use [cmd ns_http] instead.
+[para]
+ns_httppost is a wrapper around ns_httpopen to send data using HTTP
+POST method. 
 
 [section {COMMANDS}]
 
 set page [lb]ns_httppost http://www.aolserver.com[rb] "" $data
 [example_end]
 
+[see_also ns_http ns_httpget ns_httpopen ns_httptime]
+[keywords http-client] 
+
 [manpage_end]
 

File tcl/http.tcl

 
 proc ns_httpopen {method url {rqset ""} {timeout 30} {pdata ""}} {
 
+    ns_deprecated "ns_http"
     #
     # Determine if url is local; prepend site address if yes
     #
 
 proc ns_httppost {url {rqset ""} {qsset ""} {type ""} {timeout 30}} {
 
+    ns_deprecated "ns_http"
+
     #
     # Build the request. Since we're posting, we have to set
     # content-type and content-length ourselves. We'll add 
 
 proc ns_httpget {url {timeout 30} {depth 0} {rqset ""}} {
 
+    ns_deprecated "ns_http"
+
     if {[incr depth] > 10} {
         return -code error "ns_httpget: recursive redirection: $url"
     }