The following is my ajax code:

```
 $.ajax({
    url: url,
    type: type,
    data: {data:cart},
    success: function(response){
        console.log(response);
     },
     error: function(error){
     throw new Error('Did not work');
      }
    });

```

My problem is when I check console the response is XML document instead of the POST data which is the cart. I have tried to include dataType:'text' but this is only giving me the code in my url instead of the POST data. When I use dataType:'json' I still get XML document. My php code is:

```
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Send.php</title>
</head>
<body>

<?php
  print_r($POST);
?>

</body>
</html>

```

What could be the problem or what do I need to add??