PostFun
A fun F# postman alternative
While testing your endpoints in dev, you could even learn a new language:
I am a big fan of VScode rest/http scripting extension, if you hadn’t the chance to try it out already, it has an amazing HTTP DSL…
# vscode rest client files have .http extension@hostname = acme-api.dev.acme.com/@orderNumber = TEST-12345678910@path = orders/{{orderNumber}}/change-eligibility@jwt = JWT_TOKEN_STRINGGET https://{{hostname}}/{{path}}Authorization: Bearer {{jwt}}
On the other hand having the ability to write and extend DSLs in F# (CEs or computation expressions) makes the F# approach much more fun!
You just need dotnet-sdk and you are good to go on any platform.
In the script I use the amazing FsHttp library which models an extensible DSL for HTTP calls.
You can now have a bit more fun when testing your APIs, learning something along the way, with the virtually endless possibilities offered by a full-fledged language like F#.
And you have the .NET type system to help you along the way, if you are already a dotnet developer, that’s a great plus for re-using everything you know.
A small note: the library depends on FSharp.Data, so all underlying Json utility functions and types are available.
In the example above we are dynamically parsing a json, but we could also use FSharp.Data.JsonProvider to parse it in a type-safe manner instead, if we wanted…
You can find more info on HttpFs documentation.