I have an array called metrics and im trying to pass it to backend with AJAX but Im only getting the last values of the array 7,8,9 . I want to pick up the whole array .Any idea how? Any help is appreciated.
html
var metrics = [
[1,2,3],
[4,5,6],
[7,8,9],
];
$.ajax({
type : 'GET' ,
url : "...",
data : {"metrics[]": metrics },
})
views.py
def Sensor_Metrics(request):
if request.is_ajax and request.method == "GET" :
metrics = request.GET.get("metrics[]")
print(metrics)
return JsonResponse({"error": ""}, status=400)