Begin analysis of posted messages
This commit is contained in:
parent
65bec8ddbf
commit
d59ed16de4
5
httpd.ml
5
httpd.ml
|
@ -170,6 +170,11 @@ let render_fixed_content cout s headers_only =
|
|||
output_string cout "\r\n";
|
||||
if headers_only then () else output_string cout s
|
||||
|
||||
let string_of_content c =
|
||||
match c with
|
||||
| Fixed s -> s
|
||||
| Variable s -> Stringstream.to_string s
|
||||
|
||||
let render_content cout v c headers_only =
|
||||
match c with
|
||||
| Fixed s ->
|
||||
|
|
|
@ -77,6 +77,9 @@ let api_tap_source r =
|
|||
Stringstream.empty))
|
||||
|
||||
let api_tap_sink r =
|
||||
List.iter
|
||||
(fun (k, v) -> Printf.printf "%s = %s\n%!" k (match v with Some x -> x | None -> "..."))
|
||||
(Httpd.parse_urlencoded (Httpd.string_of_content r.Httpd.req_body.Httpd.content));
|
||||
Httpd.resp_generic 202 "Accepted" [] (Httpd.Fixed "")
|
||||
|
||||
let api_tap r =
|
||||
|
|
|
@ -34,7 +34,7 @@ function reset_tap_stream() {
|
|||
},
|
||||
message: function (event, stream) {
|
||||
$("#debug_container").text(JSON.stringify(event.data));
|
||||
stream.send({ok: true});
|
||||
stream.send({data: JSON.stringify({ok: true})});
|
||||
},
|
||||
error: server_disconnected,
|
||||
close: server_disconnected
|
||||
|
|
Loading…
Reference in New Issue