A replacement for Http.post that also takes a token, which is attached to the headers.
NOTE that is important to use jsonBody to ensure that the 'application/json' is added to the headers
sendToServer : String -> String -> Json.Decode.Decoder a -> Json.Encode.Value -> Cmd msg
sendToServer token url dec value =
Jwt.Http.post token
{ url = url
, body = Http.jsonBody value
, expect = Http.expectJson ContentResult (phoenixDecoder dec)
}Create a PUT command with a token attached to the headers.
Create a DELETE command with a token attached to the headers.
Helper that checks an Http.Error for a 401
A replacement for
Http.getthat also takes a token, which is attached to the headers.