Add really basic request responses
This commit is contained in:
@ -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),
|
||||
|
Reference in New Issue
Block a user