writeSuccess() public method

public writeSuccess ( ) : void
return void
Esempio n. 1
0
        public override void handleGETRequest(HttpProcessor p)
        {
            // right now we just render status onto any URL
            p.writeSuccess();
            StreamWriter s = p.outputStream;

            s.WriteLine("<html><body> <h1> StepsDB Server Status <h1> \n");
            s.WriteLine("<p>");
            s.WriteLine("<table border=1>\n");
            s.WriteLine(String.Format("<tr><td>Working Segment Size</td><td>{0}</td></tr>\n", raw_db.workingSegmentSize()));
            s.WriteLine("<tr><td>Segments</td><td>\n");

            // write out list of all segments
            {
                s.WriteLine("<table border=1>\n");
                foreach (var segment in raw_db.listAllSegments()) {
                    s.WriteLine(String.Format("<tr><td>{0}</td><Td>{1}</td></tr>\n", segment.start_key, segment.end_key));
                }
                s.WriteLine("</table>\n");
            }

            s.WriteLine("</table>\n");
        }
Esempio n. 2
0
        public override void handleGETRequest(HttpProcessor p)
        {
            Console.WriteLine("request: {0}", p.http_url);
            p.writeSuccess();
            p.outputStream.WriteLine("<html><body><h1>test server</h1>");
            p.outputStream.WriteLine("Current Time: " + DateTime.Now.ToString());
            p.outputStream.WriteLine("url : {0}", p.http_url);

            p.outputStream.WriteLine("<form method=post action=/form>");
            p.outputStream.WriteLine("<input type=text name=foo value=foovalue>");
            p.outputStream.WriteLine("<input type=submit name=bar value=barvalue>");
            p.outputStream.WriteLine("</form>");
        }