Query: ns_geturl
OS: debian
Section: 3aolserv
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
ns_geturl(3aolserver) AOLserver Built-In Commands ns_geturl(3aolserver) __________________________________________________________________________________________________________________________________________________NAMEns_geturl - commandsSYNOPSISns_geturl URL ?headersSetId? _________________________________________________________________DESCRIPTIONThis command retrieves the contents of the specified URL. The URL must be a remote http server, or a file relative to the pageroot (begins with /). It does not handle a relative request or follow redirects. The headerSetId option is a variable containing an ns_set Id (not expanded with a $) used to store the remote server headers (see example). ns_geturl only support HTTP version 1.0.EXAMPLESset page [ns_geturl "www.aolserver.com"] ns_return 200 text/html $page This fetches the contents of www.aolserver.com and returns that page to the client. set headers [ns_set new] set page [ns_geturl "www.aolserver.com" headers] for {set i 0} {$i < [ns_set size $headers]} {incr i} { ns_puts "Key: [ns_set key $headers $i]" ns_puts "Value: [ns_set value $headers $i]" } This time, a blank headerset is passed to ns_geturl so we can retrieve the headers of the remote page, which we print out to the client. set file [ns_geturl "/foo/bar.html"] ns_return 200 text/html $file This example fetches the /foo/bar.html file relative to the pageroot and returns it to the client.SEE ALSOnsd(1), info(n), ns_set(n), ns_httpget(n)KEYWORDSAOLserver 4.0 ns_geturl(3aolserver)
Related Man Pages |
---|
ns_connflushheaders(3aolserv) - debian |
ns_adp_registertag(3aolserv) - debian |
ns_crypt(3aolserv) - debian |
ns_geturl(3aolserv) - debian |
ns_returnbadrequest(3aolserv) - debian |
Similar Topics in the Unix Linux Community |
---|
Remove text between headers while leaving headers intact |
Merging of files with different headers to make combined headers file |
C++: get html page and store it in string |