Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Releases: lukewestby/elm-http-extra

Add withJsonBody

08 Mar 16:43
Compare
Choose a tag to compare

Thanks to @ento!

params = Json.Encode.object
  [ ("sortBy", Json.Encode.string "coolness")
  , ("take", Json.Encode.int 10)
  ]

post "https://example.com/api/items/1"
  |> withHeader "Content-Type" "application/json"
  |> withJsonBody params

Add withUrlEncodedBody

02 Mar 14:37
Compare
Choose a tag to compare

Thanks to @Istar-Eldritch for this contribution!

Flexible body readers

29 Feb 02:57
Compare
Choose a tag to compare

See http://lukewestby.com/post/release-elm-http-extra-5-0-0/ for the announcement and reasons for the changes!

Thanks to @fredcy and @mgold for their input leading to these changes!

Forgot to expose members of Error!

09 Feb 16:16
Compare
Choose a tag to compare

Oops. Good thing version numbers are free!

Update to README

09 Feb 14:58
Compare
Choose a tag to compare

Adds changes to send to README example

Better errors and responses!

09 Feb 14:53
Compare
Choose a tag to compare

Modifies send to accept decoders for both 2xx and non-2xx response bodies.

Adds a custom response type for which send returns a task that looks like:

type alias Response a =
  { data : a
  , status : Int
  , statusText : String
  , headers : Dict String String
  , url : String
  }

and introduces a new error type which will pass through a Response a in the case of non-2xx results:

type Error a
  = Timeout
  | UnexpectedPayload String
  | NetworkError
  | BadRequest (Response a)

This way you get built-in JSON decoding as well as response information for failed requests.

You can use this without installing elm-http explicitly now!

03 Feb 05:11
Compare
Choose a tag to compare

Re-exported a number of useful things from Http to allow folks to use this package without also importing Http. This includes Http.Error, Http.Request, Http.Settings, Http.url, as well as a new body function withMutlipartStringBody that allows key-value pair multipart bodies to be constructed automatically from List (String, String) inputs.

README typo fix

27 Jan 16:34
Compare
Choose a tag to compare

Corrects import statement in exampe

README changes that need to get into package.elm-lang.org

23 Jan 20:32
Compare
Choose a tag to compare
1.2.1

patch version bump so we can get the README updates onto the registry

Add introspection functions

23 Jan 18:25
Compare
Choose a tag to compare

Adds:

  • toRequest
  • toSettings