Smalldb-REST  v0.4
Static Public Member Functions | List of all members
JsonResponse Class Reference

Send well-formated JSON response. More...

Static Public Member Functions

static sendData ($response_data)
 Send response data when everything is ok.
 
static sendException (\Exception $ex)
 Send info about thrown exception and set proper HTTP code.
 
static writeException (\Exception $ex)
 Render exception as JSON string.
 
static writeJson ($json_data)
 Convert data to JSON and send them to client.
 

Detailed Description

Send well-formated JSON response.