You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 9, 2018. It is now read-only.
Currently, there are only two "high-level" HTTP functions, get and post. It seems to me that PUT and DELETE would also be very useful. What do you think?
Parenthetically, the Consul HTTP API supports GET, PUT, and DELETE.
I'm currently using the following implementation of putString, delString:
{-| Mirror the getString API, but for PUT requests. -}httpPutString:String->String->TaskErrorStringhttpPutString =
wrapHttpApi "PUT"{-| Mirror the getString API, but for DELETE requests. -}httpDelString:String->TaskErrorStringhttpDelString =
flip (wrapHttpApi "DELETE")""{-| Create a high-level API for some HTTP verb other than GET/POST -}wrapHttpApi:String->String->String->TaskErrorStringwrapHttpApi verb url body =let
request ={ verb = verb, headers =[], url = url, body =Http.string body }in Task.mapError promoteError (Http.send Http.defaultSettings request)`andThen` handleResponse Task.succeed
with handleResponse and promoteError copied directly from this module's source.
Currently, there are only two "high-level" HTTP functions,
getandpost. It seems to me thatPUTandDELETEwould also be very useful. What do you think?Parenthetically, the Consul HTTP API supports
GET,PUT, andDELETE.I'm currently using the following implementation of
putString,delString:with
handleResponseandpromoteErrorcopied directly from this module's source.