PHP Curl POST with JSON returns Server Error 500 - Django -


i using code below make php curl post request. tell me , why server sends me server error code 500? when open api link in browser , test json data ok. use similar code make put request , don`t have problems.

            $postarray = array(                 "email" => $email             );             $json = json_encode( $postarray, json_pretty_print );              $pl4m_url = "api-link";                $ch = curl_init($pl4m_url);             curl_setopt($ch, curlopt_customrequest, "post");               curl_setopt($ch, curlopt_httpheader, array('content-type: application/json'));             curl_setopt($ch, curlopt_returntransfer, true);             curl_setopt($ch, curlopt_postfields,$json);             curl_setopt($ch, curlopt_ssl_verifypeer, false);             curl_setopt($ch, curlopt_followlocation, 1);              $result = curl_exec($ch);             curl_close($ch);              echo $result; 


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -