0

What is the best practice to create a URI in an off-chain worker hook? The String and format! usage is discouraged. But what is the most convenient way to create a URI from given parts like hostname, path, and maybe query parameters or a request body?

1 Answer 1

1

Because a lot of crates or specs are using &str as the uri argument. I suggest still using String in OCW. You just need to write extern crate alloc; and use alloc::string::String.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.