All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thoughtworks.selenium.grid.remotecontrol.instrumentation.Response Maven / Gradle / Ivy

The newest version!
package com.thoughtworks.selenium.grid.remotecontrol.instrumentation;

import java.io.BufferedWriter;
import java.io.IOException;

/**
 * HTTP Response
 */
public class Response {
    private static final String CRLF = "\r\n";
    private final String body;

    public Response(String body) {
        this.body = body;
    }


    public void write(BufferedWriter writer) throws IOException {
        writer.write("HTTP/1.0 200 OK" + CRLF);
        writer.write("Server: Selenium Grid Echo Remote Control" + CRLF);
        writer.write("Content-type: text/html" + CRLF);

// Send a blank line to indicate the end of the header lines.
        writer.write(CRLF);

        writer.write(body);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy