mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00

Implements the new app header syntax as discussed in Zulip [1].
app [main] {
cli: platform "../platform/main.roc",
json: "../json/main.roc"
}
Old headers still parse and are automatically upgraded to the new
syntax by the formatter.
[1] 418444862
24 lines
603 B
Text
24 lines
603 B
Text
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.10.0/vNe6s9hWzoTZtFmNkvEICPErI9ptji_ySjicO6CkucY.tar.br" }
|
|
|
|
import pf.Http
|
|
import pf.Task exposing [Task]
|
|
import pf.Stdout
|
|
|
|
main =
|
|
request = {
|
|
method: Get,
|
|
headers: [],
|
|
url: "http://www.example.com",
|
|
mimeType: "",
|
|
body: [],
|
|
timeout: TimeoutMilliseconds 5000,
|
|
}
|
|
|
|
resp = Http.send! request
|
|
|
|
output =
|
|
when resp |> Http.handleStringResponse is
|
|
Err err -> crash (Http.errorToString err)
|
|
Ok body -> body
|
|
|
|
Stdout.line output
|