Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dharmatech/35eb799a219e7c4038e9 to your computer and use it in GitHub Desktop.
Save dharmatech/35eb799a219e7c4038e9 to your computer and use it in GitHub Desktop.
fn handle_request(&self, _r: &Request, w: &mut ResponseWriter) {
w.headers
.. date = Some(time::now_utc())
.. content_length = Some(14)
.. content_type = Some(MediaType {
type_: StrBuf::from_str("text"),
subtype: StrBuf::from_str("plain"),
parameters: vec!((StrBuf::from_str("charset"), StrBuf::from_str("UTF-8")))
})
.. server = Some(StrBuf::from_str("Example"));
w.write(bytes!("Hello, World!\n")).unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment