workers-rs
workers-rs copied to clipboard
[BUG] worker::RequestInit, it's always error 'invalid URL or options for Request'.
Is there an existing issue for this?
- [x] I have searched the existing issues
What version of workers-rs are you using?
0.6
What version of wrangler are you using?
4.45.3
Describe the bug
use request_init always faield. run the code.
any way catch js err?
Steps To Reproduce
// work
Request::new("https://httpbin.org/post", worker::Method::Post).unwrap();
// not work called `Result::unwrap()` on an `Err` value: JsError("invalid URL or options for Request")
let mut request_init = RequestInit::new();
request_init.method = worker::Method::Post;
Request::new_with_init("https://httpbin.org/post", &request_init).unwrap();
I tried to replicate this but I was unable to get the failure you are seeing here.
Can you share a complete end to end example for how you are getting this?