Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

求指点-post方法http://127.0.0.1/api/get-token时报500错误 #2

Open
jimmyknok opened this issue Jun 20, 2018 · 2 comments
Open

Comments

@jimmyknok
Copy link

平台:windows

步骤:

  1. 根据【中文使用手册】-【快速上手】一节中,启动FLASK,进入git-clone目录D:\Git\HttpRunner,命令行执行
SET FLASK_APP=tests/api_server.py
flask run
  1. 使用postman发送请求
    结果:返回500错误

后台返回抛出异常如下:

[2018-06-20 10:15:45,471] ERROR in app: Exception on /api/get-token [POST]
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\flask\app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "c:\python27\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "c:\python27\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "c:\python27\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "c:\python27\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "D:\Git\HttpRunner\tests\api_server.py", line 75, in get_token
    sign = data.get('sign', "")
AttributeError: 'NoneType' object has no attribute 'get'

疑问:
同样情况下,post方法请求http://127.0.0.1:5000/api/users/1可正常返回,只是由于get-token无法正常返回而权限不足无法添加。求指点。

@debugtalk
Copy link
Member

@jimmyknok 你post的数据有么?感觉是你post的body为空。

@magus2723
Copy link

后来解决掉了吗?
我也遇到get-token接口405权限不够的报错

@debugtalk debugtalk transferred this issue from httprunner/httprunner Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants