Need help with http?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

elm
141 Stars 47 Forks Other 62 Commits 28 Opened issues

Description

Make HTTP requests in Elm

Services available

!
?

Need anything else?

Contributors list

# 18,952
Shell
Haskell
single-...
repl
53 commits
# 138,724
elm
session...
login-s...
Elixir
2 commits
# 214,446
Haskell
Shell
elm
elm-lan...
1 commit
# 1,191
JavaScr...
React
GitHub
elixir-...
1 commit
# 103,405
Erlang
bittorr...
elm
gtk
1 commit

HTTP

Make HTTP requests in Elm. Talk to servers.

I very highly recommend reading through The Official Guide to understand how to use this package!

Examples

Here are some commands you might create to send HTTP requests with this package:

import Http
import Json.Decode as D

type Msg = GotBook (Result Http.Error String) | GotItems (Result Http.Error (List String))

getBook : Cmd Msg getBook = Http.get { url = "https://elm-lang.org/assets/public-opinion.txt" , expect = Http.expectString GotBook }

fetchItems : Cmd Msg fetchItems = Http.post { url = "https://example.com/items.json" , body = Http.emptyBody , expect = Http.expectJson GotItems (D.list (D.field "name" D.string)) }

But again, to really understand what is going on here, read through The Official Guide. It has sections describing how HTTP works and how to use it with JSON data. Reading through will take less time overall than trying to figure everything out by trial and error!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.