Django 服务端在返回前,设置response 的 Content-Disposition
def hello_attachment(request):
print 'In the hello_attachment, To test the attachment'
students = {'name':'rob','age':22, 'subjects':['math', 'english'], 'comment':'the mock data is from django server'}
response = HttpResponse(json.dumps(students), content_type="application/json")
# https://blog.csdn.net/chouzhao7980/article/details/100813248
response['Content-Disposition'] = "attachment; filename=django_end.txt"
return response



