コード例 #1
0
ファイル: http_service.py プロジェクト: zhengyb/tomodachi
 async def test_charset_invalid(self, request: web.Request) -> Response:
     return Response(body='test',
                     status=200,
                     headers={'Content-Type': 'text/plain; charset=utf-9'})
コード例 #2
0
ファイル: http_service.py プロジェクト: zhengyb/tomodachi
 async def test_response_object(self, request: web.Request) -> Response:
     return Response(body='test tomodachi response',
                     status=200,
                     headers={'X-Tomodachi-Response': 'test'})
コード例 #3
0
ファイル: http_service.py プロジェクト: zhengyb/tomodachi
 async def test_charset_encoding_error(self,
                                       request: web.Request) -> Response:
     return Response(
         body='test 友達',
         status=200,
         headers={'Content-Type': 'text/plain; charset=iso-8859-1'})
コード例 #4
0
ファイル: http_service.py プロジェクト: xdmiodz/tomodachi
 async def test_charset_encoding_correct(self, request: web.Request) -> Response:
     return Response(
         body="test \xe5\xe4\xf6", status=200, headers={"Content-Type": "text/plain; charset=iso-8859-1"}
     )
コード例 #5
0
ファイル: http_service.py プロジェクト: xdmiodz/tomodachi
 async def test_response_object(self, request: web.Request) -> Response:
     return Response(body="test tomodachi response", status=200, headers={"X-Tomodachi-Response": "test"})
コード例 #6
0
ファイル: http_service.py プロジェクト: xdmiodz/tomodachi
 async def test_charset_invalid(self, request: web.Request) -> Response:
     return Response(body="test", status=200, headers={"Content-Type": "text/plain; charset=utf-9"})
コード例 #7
0
 async def response_object(self, request: web.Request) -> Response:
     return Response(body='{"data": true}',
                     status=200,
                     content_type='application/json')