Skip to content

Instantly share code, notes, and snippets.

Created May 26, 2016 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/3d72907031ce18d002364e756f6c0346 to your computer and use it in GitHub Desktop.
Save anonymous/3d72907031ce18d002364e756f6c0346 to your computer and use it in GitHub Desktop.
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 {
let s: String = 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