函数计算的 Python手册小问题

136 阅读1分钟
原文链接: click.aliyun.com

函数计算的 Python手册小问题

冰山刘 2018-07-08 22:15:36 浏览83 评论0

摘要: 函数计算的 Python手册小问题 今天跟着 函数计算 Python 入门手册 一起做,被卡在下图这里报错。在关于 WSGI 普通入口函数介绍中: { "errorMessage ": " 'NoneType' object has no attribute 'split' ", "err.

函数计算的 Python手册小问题

今天跟着 函数计算 Python 入门手册 一起做,被卡在下图这里报错。在关于 WSGI 普通入口函数介绍中:
image

 {
   "errorMessage": "'NoneType' object has no attribute 'split'",
   "errorType": "AttributeError",
   "stackTrace": [
      [
         "File \"/var/fc/runtime/python2.7/src/server.py\"",
         "line 276",
         "in do_POST",
         "wsgi_handler.run(application)"
      ],
      [
         "File \"/usr/local/lib/python2.7/wsgiref/handlers.py\"",
         "line 92",
         "in run",
         "self.close()"
      ],
      [
         "File \"/usr/local/lib/python2.7/wsgiref/simple_server.py\"",
         "line 33",
         "in close",
         "self.status.split(' ',1)[0], self.bytes_sent"
      ]
   ]
} 

参考 简单的WSGI例子 - CSDN 加入这句 context('200 OK', [('Content-Type', 'text/html')])

def handler(event, context):
    context('200 OK', [('Content-Type', 'text/html')])
    return '<h1>Hello, web!</h1>'

即可。

用云栖社区APP,舒服~

【云栖快讯】云栖社区技术交流群汇总,阿里巴巴技术专家及云栖社区专家等你加入互动,老铁,了解一下?  详情请点击 评论 (0) 点赞 (0) 收藏 (0)
分享到:

相关文章

网友评论