Bend.HttpProcessor.writeSuccess C# (CSharp) Method

writeSuccess() public method

public writeSuccess ( ) : void
return void
        public void writeSuccess()
        {
            outputStream.Write("HTTP/1.0 200 OK\n");
            outputStream.Write("Content-Type: text/html\n");
            outputStream.Write("Connection: close\n");
            outputStream.Write("\n");
        }

Usage Example

Example #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");
        }
All Usage Examples Of Bend.HttpProcessor::writeSuccess