Function ehttp::fetch_async
source · pub async fn fetch_async(request: Request) -> Result<Response>
Expand description
Performs an async
HTTP request.
Available on following platforms:
- web
- native behind the
native-async
feature.
Ok
is returned if we get a response, even if it’s a 404.
Err
can happen for a number of reasons:
- No internet connection
- DNS resolution failed
- Firewall or proxy blocked the request
- Server is not reachable
- The URL is invalid
- Server’s SSL cert is invalid
- CORS errors
- The initial GET which returned HTML contained CSP headers to block access to the resource
- A browser extension blocked the request (e.g. ad blocker)
- …