Begin working on Http requests.

This commit is contained in:
2018-12-08 13:49:30 -08:00
parent c292a4c29b
commit 3656b0f3f0
7 changed files with 128 additions and 11 deletions

15
src/Scylla/Api.elm Normal file
View File

@@ -0,0 +1,15 @@
module Scylla.Api exposing (..)
import Http exposing (Header, header)
import Json.Encode as Encode
type alias ApiToken = String
type alias ApiUrl = String
basicHeaders : List Header
basicHeaders =
[ header "Content-Type" "application/json"
]
authenticatedHeaders : ApiToken -> List Header
authenticatedHeaders token =
[ header "Authorization" ("Bearer " ++ token)] ++ basicHeaders