Body
Part
Similar to Http.Error but have more informarion
Req with Error
Arbitrary method
GET
POST
PUT
PATCH
DELETE
Add text with mime type.
Add JSON for POST etc.
Add file to upload
Add bytes with mime type.
Add multipart body.
String part (key and value)
Add header
Add timeout
Allow cookies from other domains.
Create a task to parse string body.
Create a task to parse bytes body.
Ignore the result.
Create a task with existing Http.Resolver.
Make a resolver function that returns Http.Error.
getUserSimple : String -> Task Http.Error User
getUserSimple userName =
Req.get ("https://api.github.com/users/" ++ userName)
|> Req.stringTask (Req.simplyResolveJson userDecoder)Make a resolver function that returns Req.Error.
getUserSimple : String -> Task Http.Error User
getUserSimple userName =
Req.get ("https://api.github.com/users/" ++ userName)
|> Req.stringTask
(Req.resolveJson
{ decoder = userDecoder
, errorDecoder = errorDecoder
}
)
- First decoder is used for good body
- First decoder is used for bad body
- Decoding errors of both go to BadBodyresolve Json and return Error with Req.
Track progress of responses with string body.
Track progress of responses with bytes body.
Track something but ignore the result.
Make a traking Cmd using existing Http.Expect.
Request