Lesson
Make an HTTP Request in Elm
Understand the three basic parts of making HTTP requests in Elm: 1) Building the request, 2) Writing a JSON decoder, 3) Sending the request using the Elm runtime, and reacting to the results with messages. HTTP requests are just pieces of data in Elm. When we...
- Duration
- 13 min
- Access
- Free
- Transcript
- Needs source
Understand the three basic parts of making HTTP requests in Elm: 1) Building the request, 2) Writing a JSON decoder, 3) Sending the request using the Elm runtime, and reacting to the results with messages.
HTTP requests are just pieces of data in Elm. When we want to send them, we hand them off to Elm's runtime, and it notifies us when the request is done. An important part of working with HTTP requests that fetch JSON is JSON decoding, the process by which we can turn untyped JSON data into Elm types that are safe to work with.
Specs:
- Editor: Atom
- Theme: Nebula (with Nebula syntax theme)
- Font: Iosevka with ligatures enabled
- Plugin used for imports: Elmjutsu
- Plugin used for formatting: Elm-format
- Plugin used for linting: linter-elm-make