【发布时间】:2015-04-20 18:08:08
【问题描述】:
当使用 Python Eve 数据库挂钩时,我试图在 post call 上修改请求参数,但出现以下错误
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>
Internal Server Error
</h1>
<p>The server encountered an internal error and was unable to complete your
request.Either the server is overloaded or there is an error in the
application.
</p>
当我删除代码片段以修改请求参数时,资源创建成功。
请找到代码 sn-p 为:-
__author__ = 'sappal'
from eve import Eve
import time
def insert_people(items):
# retrieve request parameter, if present
print items['userid']
print items['email']
items['userid']= "Tushar_Sappal" + str(int(time.time()))
items['email'] = "sappal.tushar"+str(int(time.time()))+"@gmail.com"
print items
# Creating the instance of the EVE Application
app = Eve()
app.on_insert_people += insert_people
if __name__== '__main__':
app.run(host='0.0.0.0')
【问题讨论】:
标签: rest python-2.7 eve