Getting unexpected character at line 1 of col 2 on HTTPS whereas on HTTP its working

Same code is working on development portal which is HTTP server whereas on HTTPS server am not able to receive response

JS Code

<script language="javascript" type="text/javascript">
$(document).ready(function() {
  $('.buttonclick').on('click', function (event) {
        var otherPro =$(this).data('id');
        $('#ViewDetails').modal();
        var fillFields = function(){
        $.ajax({ 
            type: 'POST', 
            url: "view_employee_details",
            data: ({'id': otherPro}),
            datatype:'json',
            success: function(data){ 
            console.log(data);
            $.each(data, function (key, value) {
                $( '#' + key ).html( value ); 
            });

            }
        }); 
    } 
    // call the function 
    fillFields("1"); 
    });
 });

PHP function/url

public function view_employee_details()
    {

        header('Content-Type: application/json');
        $data=array();
        $employee_id=$_POST['id'];        
        $result =$this->db->query("SELECT * FROM employees WHERE id=$employee_id");
        if($result)
        $employee=$result[0];
        if(!empty($employee))
        {          
          $data=array(
            'employee_id'       =>'Employee code: '.$employee['employee_id'],
            'name'    =>'Name: '.$employee['name'],
            'email_id'            =>'Email: '.$employee['email_id'],
            'contact_no'               =>'Contact No:'.$employee['contact_no'] ,
            'designation'                 =>'Designation: '.$employee['designation']
            );
            echo json_encode($data);
        }
    }

I am receiving this response when I debugged

unexpected character at line 1 of column 2 of the JSON data with red dot {"employee_id":"Employee code: 00000000","name":"Name: Adriana Ross-Maugourd","email_id":"Email: adriana.ross01@metro.de","contact_no":"Contact No: +4915158224870","designation":"Designation: NA"}

So how do I get the response ?