pub(crate) fn into_string(self) -> String {
        let mut http = String::new();
        // Add the request line and the "Host" header
        http += &format!(
            "{} {} HTTP/1.1\r\nHost: {}\r\n",
            self.method, self.resource, self.host
        );
        // Add other headers
        for (k, v) in self.headers {
            http += &format!("{}: {}\r\n", k, v);
        }
        // Add the body
        http += "\r\n";
        if let Some(body) = self.body {
            http += &body;
        }
        http
    }
/// Returns the HTTP request as a `String`, ready to be sent to
/// the server.
Returns the HTTP request as a `String`, ready to be sent to
the server.
Returns the HTTP request as a ` String ` ready to be sent to the server .
pub(crate) fn into_string(self) -> String {
        let mut http = String::new();
        // Add the request line and the "Host" header
        http += &format!(
            "{} {} HTTP/1.1\r\nHost: {}\r\n",
            self.method, self.resource, self.host
        );
        // Add other headers
        for (k, v) in self.headers {
            http += &format!("{}: {}\r\n", k, v);
        }
        // Add the body
        http += "\r\n";
        if let Some(body) = self.body {
            http += &body;
        }
        http
    }
pub ( crate ) fn into_string ( self ) -> String { let mut http = String :: new ( ) ; // Add the request line and the "Host" header http += & format ! ( " \r \n \r \n " self method self resource self host ) ; // Add other headers for ( k , v ) in self . headers { http += & format ! ( " \r \n " k v ) ; } // Add the body http += " \r \n " ; if let Some ( body ) = self . body { http += & body ; } http }
Returns the HTTP request as a `String`, ready to be sent to
the server.
Returns the HTTP request as a ` String ` ready to be sent to the server .
self