Add really basic request responses

This commit is contained in:
2021-05-15 23:20:07 +02:00
parent 6a7e3f1135
commit 676c4e7a18
5 changed files with 64 additions and 9 deletions

View File

@ -16,11 +16,6 @@ pub enum Stream {
Ssl(SslStream<TcpStream>),
}
pub struct HttpStream {
stream: Stream,
request_num: u32,
}
pub enum Method {
GET,
POST,
@ -163,6 +158,10 @@ impl Response {
}
}
fn status(&mut self, status_code: u16) {
self.status = Status::from_code(status_code)
}
fn add_header(&mut self, name: &str, value: &str) {
self.header_fields.push(HeaderField {
name: String::from(name),