Restore HEAD and DELETE
Also, remove OPTIONS, TRACE, and PATCH from lib.rs.
This commit is contained in:
committed by
Martin Algesten
parent
aae05c5614
commit
d83de53bcd
10
src/agent.rs
10
src/agent.rs
@@ -133,6 +133,11 @@ impl Agent {
|
|||||||
self.request("GET", path)
|
self.request("GET", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Make a HEAD request from this agent.
|
||||||
|
pub fn head(&self, path: &str) -> Request {
|
||||||
|
self.request("HEAD", path)
|
||||||
|
}
|
||||||
|
|
||||||
/// Make a POST request from this agent.
|
/// Make a POST request from this agent.
|
||||||
pub fn post(&self, path: &str) -> Request {
|
pub fn post(&self, path: &str) -> Request {
|
||||||
self.request("POST", path)
|
self.request("POST", path)
|
||||||
@@ -142,6 +147,11 @@ impl Agent {
|
|||||||
pub fn put(&self, path: &str) -> Request {
|
pub fn put(&self, path: &str) -> Request {
|
||||||
self.request("PUT", path)
|
self.request("PUT", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Make a DELETE request from this agent.
|
||||||
|
pub fn delete(&self, path: &str) -> Request {
|
||||||
|
self.request("DELETE", path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_MAX_IDLE_CONNECTIONS: usize = 100;
|
const DEFAULT_MAX_IDLE_CONNECTIONS: usize = 100;
|
||||||
|
|||||||
15
src/lib.rs
15
src/lib.rs
@@ -182,21 +182,6 @@ pub fn delete(path: &str) -> Request {
|
|||||||
request("DELETE", path)
|
request("DELETE", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Make a TRACE request.
|
|
||||||
pub fn trace(path: &str) -> Request {
|
|
||||||
request("TRACE", path)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Make an OPTIONS request.
|
|
||||||
pub fn options(path: &str) -> Request {
|
|
||||||
request("OPTIONS", path)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Make an PATCH request.
|
|
||||||
pub fn patch(path: &str) -> Request {
|
|
||||||
request("PATCH", path)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user