Json Module

Functions and values

Function or value Description

fromJson bytes

Full Usage: fromJson bytes

Parameters:
    bytes : byte[]

Returns: 'T

Transform the byte array representing a JSON object to a .Net object

bytes : byte[]
Returns: 'T

mapJson

Full Usage: mapJson

Returns: ('T1 -> 'T2) -> HttpContext -> Async<HttpContext option>
 Expose function f through a json call; lets you write like

 let app =
   url "/path"  >>= map_json some_function;
Returns: ('T1 -> 'T2) -> HttpContext -> Async<HttpContext option>

mapJsonWith deserializer serializer f

Full Usage: mapJsonWith deserializer serializer f

Parameters:
    deserializer : byte[] -> 'TIn
    serializer : 'TOut -> byte[]
    f : 'TIn -> 'TOut

Returns: HttpContext -> Async<HttpContext option>

Expose function f through a json call where you decide which serializer to use.

deserializer : byte[] -> 'TIn
serializer : 'TOut -> byte[]
f : 'TIn -> 'TOut
Returns: HttpContext -> Async<HttpContext option>

toJson o

Full Usage: toJson o

Parameters:
    o : 'T

Returns: byte[]

Convert the object to a JSON representation inside a byte array (can be made string of)

o : 'T
Returns: byte[]