Function ehttp::fetch_blocking
source · pub fn fetch_blocking(request: &Request) -> Result<Response>Expand description
Performs a HTTP request and blocks the thread until it is done.
Only available when compiling for native.
NOTE: Ok(…) is returned on network error.
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)
- …