0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Pyramidでjsonを返す

0
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?