Support webdav request method #402
abersheeran
started this conversation in
Ideas
Replies: 1 comment
-
https://docs.rs/http/latest/http/method/struct.Method.html How about using http::Method? use http::Method as HttpMethod;
use worker::{Method as WorkerMethod, *};
fn handle_request(req: Request, env: Env) -> Result<Response> {
let worker_method: WorkerMethod = req.method();
let method_str = worker_method.as_str();
let http_method = HttpMethod::from_bytes(method_str.as_bytes())
.unwrap_or(HttpMethod::GET);
// ...
Response::ok("Hello!")
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have reviewed the Rust source code, and currently it is using an enumeration type. However, if it is changed to a String, then it will be able to support any HTTP request method just like in a JavaScript environment.
Beta Was this translation helpful? Give feedback.
All reactions