Subscribed unsubscribe Subscribe Subscribe

F# Monkey

about

Suave server から json を出力する

こんな感じで

#r @"./packages/Newtonsoft.Json/lib/net45/Newtonsoft.Json.dll"
open Newtonsoft.Json

#r @"./packages/FsPickler/lib/net45/FsPickler.dll"
#r @"./packages/FsPickler.Json/lib/net45/FsPickler.Json.dll"
open MBrace.FsPickler
open MBrace.FsPickler.Json

#r @"./packages/Suave/lib/net40/Suave.dll"
open Suave
open Suave.Operators
open Suave.Successful
open Suave.Filters
open Suave.RequestErrors



// o はレコードとかリストとか
let jsonSerializer = FsPickler.CreateJsonSerializer(indent = false, omitHeader = true)
OK ( jsonSerializer.PickleToString(o) )
Remove all ads