Parse a URL string into a Request.
Supports http:// and https:// schemes.
Returns none on malformed URLs.
$$\text{parseUrl} : \text{String} \to \text{Option Request}$$
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parse a URL, throwing an IO error on failure.
Equations
- Network.HTTP.Simple.parseUrl! url = match Network.HTTP.Simple.parseUrl url with | some req => pure req | none => throw (IO.Error.userError (toString "Failed to parse URL: " ++ toString url))
Instances For
Perform a simple GET request and return the response body as a ByteArray. $$\text{simpleHttp} : \text{String} \to \text{IO ByteArray}$$
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform an HTTP request and return the full response with a ByteArray body. $$\text{httpBS} : \text{Request} \to \text{IO Response}$$
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform an HTTP request and return the response body as a ByteArray.
Alias for httpBS that returns just the body.
$$\text{httpLbs} : \text{Request} \to \text{IO ByteArray}$$
Equations
- Network.HTTP.Simple.httpLbs req = do let resp ← Network.HTTP.Simple.httpBS req pure resp.body