title: API call returning error while using CURL in php
body: <p>I am calling a web service at 
  <a href="http://test.dnb.avantimedns.se/drombolig/webservices/autoprospectservice.asmx?op=SaveAutoprospect" rel="nofollow noreferrer">http://test.dnb.avantimedns.se/drombolig/webservices/autoprospectservice.asmx?op=SaveAutoprospect</a></p>
  
  <p>API KEY: de2de92-5d8c-4dcc-8573-9354b96ba683
  OBJECT ID: 90160211</p>
  
  <p>but it is not returning valid response. Below is my code. Kindly help in fixing.</p>
  
  <pre><code>$curl = curl_init();
  curl_setopt_array($curl, array(
  CURLOPT_URL =&gt; "http://test.dnb.avantimedns.se/drombolig/webservices/autoprospectservice.asmx?op=SaveAutoprospect",
  CURLOPT_RETURNTRANSFER =&gt; true,
  CURLOPT_ENCODING =&gt; "",
  CURLOPT_MAXREDIRS =&gt; 10,
  CURLOPT_TIMEOUT =&gt; 30,
  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =&gt; "POST",
  CURLOPT_POSTFIELDS =&gt; '{\n \"autoprospect\": \"{\\"SendAdditionalProspects\\":false,\\"RequestsEconomicalAdvice\\":false,\\"RequestsAssessment\\":false,\\"UserEmailsuccess\\":true,\\"ApprovesContact\\":true,\\"ObjectId\\":\\"90160211\\",\\"Source\\":\\"Company\\",\\"Name\\":\\"Test Testsson\\",\\"Email\\":\\"test@test.com\\",\\"ZipCode\\":\\"12345\\",\\"Phone\\":\\"1234567890\\",\\"Message\\":\\"Test\\"}\",\n \"apikey\": \"de2de92-5d8c-4dcc-8573-9354b96ba683\"\n \n}',
  
  CURLOPT_HTTPHEADER =&gt; array("content-type: application/json"),
  ));
  $response = curl_exec($curl);
  $err = curl_error($curl);
  curl_close($curl);
  if ($err) {
  echo "cURL Error #:" . $err;
  } else {
  echo $response;
  }
  </code></pre>