changed response mimetype for api from application/javascript to application/json (rfc 4627)

This commit is contained in:
Konrad Mohrfeldt 2011-05-25 15:53:31 +02:00
parent dec55d9561
commit 19ae56b1e0
1 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ def showItems(request):
#return json-container #return json-container
container = serializers.serialize('json', items) container = serializers.serialize('json', items)
return HttpResponse(container,'application/javascript') return HttpResponse(container,'application/json')
@login_required @login_required
def showItem(request, itemid): def showItem(request, itemid):
@ -26,7 +26,7 @@ def showItem(request, itemid):
#return json-container #return json-container
container = serializers.serialize('json', [item]) container = serializers.serialize('json', [item])
return HttpResponse(container,'application/javascript') return HttpResponse(container,'application/json')
@login_required @login_required
@ -59,7 +59,7 @@ def buyItem(request, itemid, buymode=""):
#return json-container #return json-container
#container = serializers.serialize('json', items) #container = serializers.serialize('json', items)
#return HttpResponse(container,'application/javascript') #return HttpResponse(container,'application/json')
return HttpResponse(status=200) return HttpResponse(status=200)
#return HttpResponseRedirect("/store/bought/%s/" % (order.id)) #return HttpResponseRedirect("/store/bought/%s/" % (order.id))
@ -68,5 +68,5 @@ def history(request):
hist = Order.objects.filter(user=request.user.id).order_by("-dateTime") hist = Order.objects.filter(user=request.user.id).order_by("-dateTime")
#return json-container #return json-container
container = serializers.serialize('json', [hist]) container = serializers.serialize('json', [hist])
return HttpResponse(container,'application/javascript') return HttpResponse(container,'application/json')