MCPcopy
hub / github.com/google/clusterfuzz / render_json

Method render_json

src/appengine/handlers/base_handler.py:216–224  ·  view source on GitHub ↗

Write JSON response.

(self, values, status=200)

Source from the content-addressed store, hash-verified

214 """A hook for modifying values before render_json."""
215
216 def render_json(self, values, status=200):
217 """Write JSON response."""
218 response = Response()
219 response = self._add_security_response_headers(response)
220 response.headers['Content-Type'] = 'application/json'
221 self.before_render_json(values, status)
222 response.data = json.dumps(values, cls=JsonEncoder)
223 response.status_code = status
224 return response
225
226 def handle_exception(self, exception):
227 """Catch exception and format it properly."""

Callers 15

postMethod · 0.95
handle_exceptionMethod · 0.95
postMethod · 0.95
postMethod · 0.95
postMethod · 0.95
getMethod · 0.95
postMethod · 0.95
postMethod · 0.95
postMethod · 0.95
postMethod · 0.95
postMethod · 0.95

Calls 2

before_render_jsonMethod · 0.95

Tested by 15

getMethod · 0.76
postMethod · 0.64
postMethod · 0.64
postMethod · 0.64
postMethod · 0.64
_handle_uploadMethod · 0.64
getMethod · 0.64
getMethod · 0.64
getMethod · 0.64
getMethod · 0.64
postMethod · 0.64
postMethod · 0.64