[0001] [0002] [0003] [0004] [0005] [0006] [0007] [0008] [0009] [0010] [0011] [0012] [0013] [0014] [0015] [0016] [0017] [0018] [0019] [0020] [0021] [0022] [0023] [0024] [0025] [0026] [0027] [0028] [0029] [0030] [0031] [0032] [0033] [0034] [0035] [0036] [0037] [0038] [0039] [0040] [0041] [0042] [0043] [0044] [0045] [0046] [0047] [0048] [0049] [0050] [0051] [0052] [0053] [0054] [0055] [0056] [0057] [0058] [0059] [0060] [0061] [0062] [0063] [0064] [0065] [0066] [0067] [0068] [0069] [0070] [0071] [0072] [0073] [0074] [0075] [0076] [0077] [0078] [0079] [0080] [0081] [0082] [0083] [0084] [0085] [0086] [0087] [0088] [0089] [0090] [0091] [0092] [0093] [0094] [0095] [0096] [0097] [0098] [0099] [0100] [0101] [0102] [0103] [0104] [0105] [0106] [0107] [0108] [0109] [0110] [0111] [0112] [0113] [0114] [0115] [0116] [0117] [0118] [0119] [0120] [0121] [0122] [0123] [0124] [0125] [0126] [0127] [0128] [0129] [0130] [0131] [0132] [0133] [0134] [0135] [0136]
$! FETCH.C Usage Example $! Submitted by example form WASD_ROOT:[SRC.MISC]FETCH_EXAMPLE.HTML $! 01-OCT-2002 MGD reworked $! 14-APR-1999 MGD initial $! $! set verify $! show sym www_* $ set noon $ say = "write sys$output" $ fetch = "$cgi-bin:[000000]fetch" $! $ if f$type(WWW_FORM_HTTP_METHOD) .eqs. "" then WWW_FORM_HTTP_METHOD = "" $ if f$type(WWW_FORM_HTTP_VERSION) .eqs. "" then WWW_FORM_HTTP_VERSION = "" $ if f$type(WWW_FORM_URL) .eqs. "" then WWW_FORM_URL = "" $ if f$type(WWW_FORM_SUBMIT) .eqs. "" then WWW_FORM_SUBMIT = "" $! $ if f$locate("Responding",WWW_FORM_SUBMIT) .lt. f$length(WWW_FORM_SUBMIT) $ then $! $! ***** RESPONDING? BUTTON ***** $! $ say "Content-Type: text/plain" $ say "" $ fetch /url=*WWW_FORM_URL /check $ last$STATUS = $STATUS $ if last$STATUS $ then $ say "Server responded successfully!" $ else $ if f$type(fetch_status) .eqs. "" $ then $ say "Server did not respond ... ''f$message(last$STATUS)'" $ else $ say "Server responded with an error ... ''fetch_status'" $ endif $ endif $ exit $ endif $! $ if f$locate("Header",WWW_FORM_SUBMIT) .lt. f$length(WWW_FORM_SUBMIT) $ then $! $! ***** HEADER BUTTON ***** $! $ say "Content-Type: text/plain" $ say "" $ fetch /url=*WWW_FORM_URL - /header /nobody - /method=*WWW_FORM_HTTP_METHOD - /version=*WWW_FORM_HTTP_VERSION $ if .not. $STATUS $ then $ say "Script responded with an error ... ''fetch_response'" $ endif $ exit $ endif $! $ if f$locate("Body",WWW_FORM_SUBMIT) .lt. f$length(WWW_FORM_SUBMIT) $ then $! $! ***** BODY BUTTON ***** $! $ say "Content-Type: text/plain" $ say "" $ fetch /url=*WWW_FORM_URL - /body /noheader - /method=*WWW_FORM_HTTP_METHOD - /version=*WWW_FORM_HTTP_VERSION $ if .not. $STATUS $ then $ say "Script responded with an error ... ''fetch_response'" $ endif $ exit $ endif $! $ if f$locate("Both",WWW_FORM_SUBMIT) .lt. f$length(WWW_FORM_SUBMIT) $ then $! $! ***** BOTH BUTTON ***** $! $ say "Content-Type: text/plain" $ say "" $ fetch /url=*WWW_FORM_URL - /body /header - /method=*WWW_FORM_HTTP_METHOD - /version=*WWW_FORM_HTTP_VERSION $ if .not. $STATUS $ then $ say "Script responded with an error ... ''fetch_response'" $ endif $ exit $ endif $! $ if f$locate("Response",WWW_FORM_SUBMIT) .lt. f$length(WWW_FORM_SUBMIT) $ then $! $! ***** RESPONSE BUTTON ***** $! $ fetch /url=*WWW_FORM_URL - /method=*WWW_FORM_HTTP_METHOD - /version=*WWW_FORM_HTTP_VERSION $ if .not. $STATUS $ then $ say "Script responded with an error ... ''fetch_response'" $ endif $ exit $ endif $! $ if f$locate("Demonstrate",WWW_FORM_SUBMIT) .lt. f$length(WWW_FORM_SUBMIT) $ then $! $! ***** DEMONSTRATE BUTTON ***** $! $ url = "http://" + WWW_SERVER_NAME + ":" + WWW_SERVER_PORT +- "/wasd_root/src/misc/readme.html" $ say "Content-Type: text/html" $ say "" $ say "<B>This is the WASD_ROOT:[SRC.MISC]README.HTML document via:" $ say "<PRE> $ FETCH /URL=""''Url'"" /body /noheader</PRE></B>" $ say "<HR ALIGN=left SIZE=3 NOSHADE WIDTH=85%>" $ say "" $ fetch /url=*Url /body /noheader $ say "<HR ALIGN=left SIZE=3 NOSHADE WIDTH=85%>" $ say "<P><B>This is the WASD_ROOT:[SRC.MISC]README.HTML document via:" $ say "<PRE> $ FETCH /URL=""''Url'"" /body /noheader /escape</PRE></B>" $ say "<HR ALIGN=left SIZE=3 NOSHADE WIDTH=85%>" $ say "<PRE>" $ fetch /url=*Url /body /noheader /escape $ say "</PRE>" $ say "<HR ALIGN=left SIZE=3 NOSHADE WIDTH=85%>" $ exit $ endif $! $ say "Content-Type: text/html" $ say "" $ say "<B>Press one of the [action] buttons!</B>"