vector/sources/util/http/
method.rs1use http::Method;
2use vector_lib::configurable::configurable_component;
3
4#[configurable_component]
6#[derive(Clone, Copy, Debug)]
7#[serde(rename_all = "UPPERCASE")]
8pub enum HttpMethod {
9 Head,
11
12 Get,
14
15 Post,
17
18 Put,
20
21 Patch,
23
24 Delete,
26
27 Options,
29}
30
31impl From<HttpMethod> for Method {
32 fn from(http_method: HttpMethod) -> Self {
33 match http_method {
34 HttpMethod::Head => Self::HEAD,
35 HttpMethod::Get => Self::GET,
36 HttpMethod::Post => Self::POST,
37 HttpMethod::Put => Self::PUT,
38 HttpMethod::Patch => Self::PATCH,
39 HttpMethod::Delete => Self::DELETE,
40 HttpMethod::Options => Self::OPTIONS,
41 }
42 }
43}