getto-systems / elm-http-part / Getto.Http.Part

build http parts

roles = [ "admin" ] |> Set.fromList
comments = [ "good", "great" ]

[ ( "name", "John" |> Part.string )
, ( "age",  30     |> Part.int )
, ( "file", file   |> Part.file )
, ( "roles",    roles    |> Part.set Part.string )
, ( "comments", comments |> Part.list Part.string )
] |> Part.object

Definition


type Value

part value

Encoder

string : String -> Value

string part

int : Basics.Int -> Value

int part

file : File -> Value

file part

bytes : String -> Bytes -> Value

bytes part

list : (a -> Value) -> List a -> Value

list part

object : List ( String, Value ) -> Value

object part

Encode

toBody : Value -> Http.Body

convert value to http part