from django_render.annotations import * | |
@url(r'^/index$', method=M.POST) | |
@post(text=str) | |
def index(request, text): | |
''' | |
curl -X "POST" -F "text=str" http://hostname.com/index | |
''' | |
return {'hello': text} |
![]() |
1
wanjun 2014-11-02 09:18:33 +08:00
很像java
|
![]() |
2
virusdefender 2014-11-02 10:11:40 +08:00
django rest framework里面是这样的
class ***View(APIView): def get(): #处理get请求 def post(): #处理post请求 |
![]() |
3
wangleineo 2014-11-02 14:09:31 +08:00 ![]() @wangtai 有意思,原来url dispatch还可以这样玩。
|
![]() |
4
wangtai OP |