Custom Request implementation which uses our custom and faster json serializer and deserializer.
| 151 | |
| 152 | |
| 153 | class Request(webob.Request): |
| 154 | """ |
| 155 | Custom Request implementation which uses our custom and faster json serializer and deserializer. |
| 156 | """ |
| 157 | |
| 158 | def _json_body__get(self): |
| 159 | return json_decode(self.body.decode(self.charset)) |
| 160 | |
| 161 | def _json_body__set(self, value): |
| 162 | self.body = json_encode(value).encode("utf-8") |
| 163 | |
| 164 | def _json_body__del(self): |
| 165 | return super(Request, self)._json_body__del() |
| 166 | |
| 167 | json = json_body = property(_json_body__get, _json_body__set, _json_body__del) |
| 168 | |
| 169 | |
| 170 | class Response(webob.Response): |
no outgoing calls