1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN">
6 <style type=
"text/css">
9 font-family: verdana
, sans-serif
;
29 text-decoration:underline
;
34 text-decoration: none
;
47 border-bottom-width:1px;
48 border-bottom-style:dotted
;
64 <table width=
"90%" border=
"0" cellspacing=
"1" cellpadding=
"5">
67 <big><tt>Global.helma.Http.prototype.setResponseHandler
(callback)
</tt></big><br>
73 Overloads the default response handler.
74 Use this do implement your own response handling, like storing the response directly to the harddisk
75 The handler function gets two parameter, first is the java.net.URLConnection and second is the result object.
76 Note that custom response handler functions should check the HTTP status code before reading
77 the response. The status code for successful requests is
200. Response bodies for requests with
78 status codes less than
400 can be read from the connection's input stream, while response bodies
79 with
4xx or
5xx status codes must be read using the error stream.
<br><br>
82 <li><b>Parameter
</b> <code>{function}
</code>:
<br/>
83 Response handler function
94 <table width=
"90%" border=
"0" cellspacing=
"1" cellpadding=
"5">
96 <td>Sourcecode in /root/helma-
1.6.1/modules/helma/Http.js:
97 <pre><font color=
"#aaaaaa">440:
</font> this.setResponseHandler = function(callback) {
98 <font color=
"#aaaaaa">441:
</font> responseHandler = callback;
99 <font color=
"#aaaaaa">442:
</font> return;
100 <font color=
"#aaaaaa">443:
</font> }