Open gmg137 opened 4 years ago
Hi, thanks for raising! I've been thinking of how to solve this, and what we probably want is to be able to take TryInto<Url>
as the type parameter. For that purpose I've filed:
This would require the usage to:
let res = surf::get("abc")?.recv_string(data).await;
Which would provide graceful error handling rather than directly panicking.
However the solution to your exact issue is to use a fullly-formed url. E.g.
let res = surf::get("http://my-domain.com/abc").recv_string(data).await;
Do you still want to take TryInto<Url>
as parameters? I think this also applies to other methods. I could help a PR if this is what it prefers to be.
It looks like TryInto<Url>
support is still waiting for a new release of the url
crate.
As above, this will cause the program to crash.