mirror of
https://github.com/vbrandl/bind9-api.git
synced 2024-11-22 03:43:49 +01:00
Move hyper dependency to the client
This commit is contained in:
parent
84c79ce9b4
commit
6eacab00f9
@ -45,6 +45,8 @@ extern crate crypto;
|
||||
extern crate data;
|
||||
extern crate failure;
|
||||
#[macro_use]
|
||||
extern crate hyper;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate openssl_probe;
|
||||
extern crate pretty_env_logger;
|
||||
@ -65,6 +67,8 @@ use std::borrow::Cow;
|
||||
|
||||
type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
header! { (XApiToken, data::TOKEN_HEADER) => [String] }
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Copy)]
|
||||
enum Method {
|
||||
POST,
|
||||
@ -114,7 +118,7 @@ fn call_api<D: serde::Serialize>(
|
||||
client.post(&url)
|
||||
} else {
|
||||
client.delete(&url)
|
||||
}.header(data::XApiToken(signature))
|
||||
}.header(XApiToken(signature))
|
||||
.json(&data)
|
||||
.send()?)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user