Browse Source

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

master
Konrad Mohrfeldt 12 years ago
parent
commit
19ae56b1e0
  1. 8
      k4ever/api/views.py

8
k4ever/api/views.py

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

Loading…
Cancel
Save