Skip to main content

gateio_rs/http/
method.rs

1/// HTTP methods supported by the Gate.io API
2#[derive(PartialEq, Eq, Clone, Debug)]
3pub enum Method {
4    /// GET method for retrieving data
5    Get,
6    /// POST method for creating resources
7    Post,
8    /// PUT method for updating resources
9    Put,
10    /// DELETE method for removing resources
11    Delete,
12    /// PATCH method for partial updates
13    Patch,
14}
15
16impl AsRef<str> for Method {
17    fn as_ref(&self) -> &str {
18        match self {
19            Method::Post => "POST",
20            Method::Delete => "DELETE",
21            Method::Get => "GET",
22            Method::Put => "PUT",
23            Method::Patch => "PATCH",
24        }
25    }
26}