fn send_body(&self, body: String) {
        // convert body and use the length for the content length
        let bytes = body.as_bytes().to_vec();
        // send ok with length of body
        let form_ok = format!("HTTP/1.1 200 OK\r\nContent-Length:{}\r\n\r\n", bytes.len());
        self.send_network_bytes(form_ok.as_bytes().to_vec());
        // send the body
        self.send_network_bytes(bytes);
    }
// Assemble a 200 OK response that includes a body
Assemble a 200 OK response that includes a body
Assemble a 200 OK response that includes a body
fn send_body(&self, body: String) {
        // convert body and use the length for the content length
        let bytes = body.as_bytes().to_vec();
        // send ok with length of body
        let form_ok = format!("HTTP/1.1 200 OK\r\nContent-Length:{}\r\n\r\n", bytes.len());
        self.send_network_bytes(form_ok.as_bytes().to_vec());
        // send the body
        self.send_network_bytes(bytes);
    }
fn send_body ( & self , body : String ) { // convert body and use the length for the content length let bytes = body . as_bytes ( ) . to_vec ( ) ; // send ok with length of body let form_ok = format ! ( " \r \n \r \n \r \n " bytes len ( ) ) ; self . send_network_bytes ( form_ok . as_bytes ( ) . to_vec ( ) ) ; // send the body self . send_network_bytes ( bytes ) ; }
Assemble a 200 OK response that includes a body
Assemble a 200 OK response that includes a body
&self
body
String