workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

[BUG] worker::RequestInit, it's always error 'invalid URL or options for Request'.

Open ganluo960214 opened this issue 2 months ago • 1 comments

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();

ganluo960214 avatar Nov 03 '25 02:11 ganluo960214

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?

guybedford avatar Nov 05 '25 02:11 guybedford