title: php curl rest api response not in json format
body: <p>I doing a post curl request </p>
  
  <pre><code>        $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData));
          curl_setopt($ch, CURLOPT_POST, 1);
          $headers = array();
          $headers = ["Content-Type:application/json","Accept:application/json"];
          curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  
          $result = curl_exec($ch);
          if (curl_errno($ch)) {
              echo 'Error:' . curl_error($ch);
          }
          curl_close ($ch);
          return $result;
  </code></pre>
  
  <p>The above curl request should return a json formated string but getting a string in javascript object form.</p>
  
  <pre><code>string(68) "{data:{errorCode:AC01,errorMessage:SansID 53563857 is exist.}}"
  </code></pre>
  
  <p>Where as when i try to do the same thing from post man api is returning perfect json.</p>
  
  <pre><code>{"data":{"errorCode":"AC01","errorMessage":"SansID 53563857 is exist."}}
  </code></pre>
  
  <p>Please let me know where i'm doing wrong.</p>