-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Description
Hello guys,
in the past week I implemented an equivalent of Http.fs for Fable. This implementation is a port inspired by Elm and elm-http-builder.
Example of the Api:
// Query an url and expect a string as response
let request =
Http.get "http://localhost:3000/posts/1"
|> Http.withExpect Http.expectString
// Query with queryParams, a cacheBuster
let request =
Http.get "http://localhost:3000/posts/1"
|> Http.withQueryParams
[ "firstname", "maxime"
"surname", "mangel" ]
|> Http.withCacheBuster "cacheBuster"
|> Http.withExpect (Http.expectStringResponse (fun response -> Ok response.Url ))As you can see the philosophy, is similar with Http.fs.
I propose to provide the same Api for the request builder in Thot.Http. This should make it possible to share Request code between the server and the client.
The common code would be the request builder and each platform would have it's own runner.
- Hopac +
HttpClientfor NetCore runtime XMLHttpRequestfor Fable runtime
Are you ok with this vision ? And so ok if I take part of the Http.fs code ?
Reactions are currently unavailable