Forked from anonymous/gist:3d72907031ce18d002364e756f6c0346
Created
May 26, 2016 18:07
-
-
Save steveklabnik/54cf7a4a522cd1a7c6e0130760903b75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s; | |
let mut req = self.client | |
.post(&addr) | |
.header(Connection::close()) | |
.header(ContentType::json()) | |
.header(Authorization(Bearer { token: String::from(self.token) })); | |
if let &mut Some(ref c) = context { | |
s = match serde_json::to_string(c) { | |
Ok(r) => r, | |
Err(_) => return Converse::Result::Error("serde_json::to_string(context) failed."), | |
}; | |
req = req.body(&s); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment