Question: here's my ajax

```
        var data = {
            user_id : <?php echo $this->session->userdata('id') ?>,
            no_s0 : $('#no_so').val(),
            catatan : $('#remarks').val(),
            kode_barang : $('#kode_barang').val(),
            nama_toko : $('input[id="nama_toko"]').map(function(){return $(this).val()}).get(),
            pcs : $('input[id="pcs"]').map(function(){return $(this).val()}).get(),
            diskon : $('input[id="diskon"]').map(function(){return $(this).val()}).get()
        }

$.ajax({
            url : '<?php echo base_url('sales_so/input') ?>',
            type : 'POST',
            data : data,
            error : function(){
                alert('gagal')
            },
            success : ()=>{
                alert('berhasil')
            }
        })

```

the status code is 200, and it worked fine. the problem is that i did not get any data from this. I tried to var\_dump the data, but it give me this : array(0) { }

here's my controller :

```
$post = $this->input->post();
var_dump($post);

```

edit : please help, i still can't find the solution.

Answer: 
You can use serializeArray

`fields = $ ("#element").serializeArray();`
What happens when you put this in your controller?

```
$post = json_decode(file_get_contents("php://input"));
var_dump($post);

```