idris2-http
idris2-http copied to clipboard
Failed to make an HTTP request
I made an HTTP request and got an error. Can anyone help? My code:
blockNumber : EitherT String IO ()
blockNumber = map_error show $ with_client {e=()} new_client_default $ \client => do
let header : List (String, String) = [("Content-Type", "application/json")]
body : String = "{\"id\":1, \"jsonrpc\":\"2.0\", \"method\":\"eth_blockNumber\", \"params\":[]}"
(response, content) <- request client POST (url' "https://sepolia.gateway.tenderly.co") header body
content <- toList_ content
printLn $ utf8_pack $ content
Return:
Just "{\"error\":{\"slug\":\"route_not_found\",\"message\":\"Requested route not found\"}}"