<s> import json <EOL> def index ( ) : <EOL> envObject = request . env <EOL> envJSON = { } <EOL> for key in envObject : <EOL> value = envObject [ key ] <EOL> if isinstance ( value , dict ) or isinstance ( value , list ) or isinstance ( value , tuple ) or isinstance ( value , str ) or isinstance ( value , unicode ) or isinstance ( value , int ) or isinstance ( value , long ) or isinstance ( value , float ) or value is None or value is True or value is False : <EOL> envJSON [ key ] = value <EOL> else : <EOL> envJSON [ key ] = '<STR_LIT>' <EOL> data = { <EOL> '<STR_LIT>' : envJSON , <EOL> '<STR_LIT>' : request . cookies , <EOL> '<STR_LIT>' : request . vars , <EOL> '<STR_LIT>' : request . get_vars , <EOL> '<STR_LIT>' : request . post_vars , <EOL> '<STR_LIT>' : request . folder , <EOL> '<STR_LIT>' : request . application , <EOL> '<STR_LIT>' : request . controller , <EOL> '<STR_LIT>' : request . function , <EOL> '<STR_LIT:args>' : request . args , <EOL> '<STR_LIT>' : request . extension , <EOL> '<STR_LIT>' : str ( request . now ) <EOL> } <EOL> dataStr = json . dumps ( data , encoding = '<STR_LIT:utf-8>' , indent = <NUM_LIT:2> , sort_keys = True ) <EOL> response . headers [ '<STR_LIT:Content-Type>' ] = '<STR_LIT:application/json>' <EOL> return dataStr </s>
