request.query_params 中可以获取?param1=32¶m2=23形式的参数.返回的数据类型为QueryDict
url
http://ip:port/api/v0.1/cm/list?ip=all
路由urls
url(r'^/api/v0.1/cm/list', CmcViews.HddInfoViews.as_view(), name='disklist'),
viwes
def get(self, request, format=None):
# 获取url参数
query = request.query_params
网友评论