Django1.7b版本中HttpResponse中 移除了参数mimetype=’application/json’ 这样的写法
2014-09-28 11:04
731 查看
django1.7之前,这样用:
HttpResponse(simplejson.dumps({“status”: ‘200’, “message”:u’登录成功’}), mimetype=’application/json’)
没问题,但是django1,7之后就报错了,查了下问题发现应该这样用:
HttpResponse(simplejson.dumps({“status”: ‘200’, “message”:u’登录成功’}),content_type=’application/json’)
不知道是我以前一直都用错了还是django1.7之后把方法参数改了
备注下!
HttpResponse(simplejson.dumps({“status”: ‘200’, “message”:u’登录成功’}), mimetype=’application/json’)
没问题,但是django1,7之后就报错了,查了下问题发现应该这样用:
HttpResponse(simplejson.dumps({“status”: ‘200’, “message”:u’登录成功’}),content_type=’application/json’)
不知道是我以前一直都用错了还是django1.7之后把方法参数改了
备注下!
相关文章推荐
- Django JsonResponse与HttpResponse重要区别
- [py]django url 参数/reverse和HttpResponseRedirect
- django 使用HttpResponse返回json数据为中文
- Java http get/post 传递json参数问题 .
- Java乔晓松-ajax开发框架和XMLhttpRequest、responseText、responseXml和JSON的应用
- WebService中应用HttpContext(Request、Response、Session、Application)
- Response.End()出错可以替换为HttpContext.Current.ApplicationInstance.CompleteRequest()
- http GET && POST,django 的 httpresponse
- BEA-141150 - An error occurred while preparing application component uri of application application with HTTP response responseCode: message
- C++中使用Json格式作为http的response返回值
- Ext.data.JsonStore使用HttpProxy加载数据时传递参数的两种方法
- Java http get/post 传递json参数问题
- javax.servlet.http.HttpServletResponse接口(HTTP版本)
- Django Push HTTP Response to users
- django httpresponse status code
- ajax开发框架和XMLhttpRequest、responseText、responseXml和JSON的应用
- from django.http import HttpResponseRedirect
- The content type application/json of the response message does not match the content type of the binding (application/soap+xml;
- 关天response.setContentType()和application/json
- json应用,responseText,responseXml,XMLhttpRequest和ajax开发框架