LoginSignup
0
0

More than 5 years have passed since last update.

Pyramidでjsonを返す

Posted at

PyramidのViewでjsonを返す。

from pyramid.view import Response
from pyramid.view import view_config

@view_config(route_name='json')
def func(request):
  body = u'''
{{
"key": "value"
}}
  '''
  return Response(body=body, headerlist=[('Content-Type', 'application/json')])

Responseクラスを使って返却します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0