I am trying to get data from e-autopay. Upload your orders, because This site has no intelligent API. But I can not log in there. I’m sending the same headers using curl, but no matter what I’ve tried, error 500 always comes out. Tell me, by what other parameters can the system not let me in?

Sending token, cookies, referer, origin Function

$ch = curl_init(); $ref="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"; curl_setopt($ch, CURLOPT_URL, $url ); curl_setopt($ch, CURLOPT_HEADER, 1); $request = 'Origin:https://domen.e-autopay.com Referer:https://domen.e-autopay.com/adminka/login/co-worker'; $split = explode("\n",$request); curl_setopt ($ch, CURLOPT_HTTPHEADER,$split ); curl_setopt($ch, CURLINFO_HEADER_OUT, 1); curl_setopt($ch, CURLOPT_USERAGENT, $ref); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 400); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch,CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt'); curl_setopt($ch,CURLOPT_COOKIEJAR,dirname(__FILE__).'/cookie.txt'); curl_setopt($ch, CURLOPT_POST, $post!==0 ); if($post) curl_setopt($ch, CURLOPT_POSTFIELDS, 'login="mylogin"&password="mypassword"&_token="'.$token.'"');//токен забрал выше $curl=curl_exec($ch); $data = new simple_html_dom(); $data->load($curl); $status = curl_getinfo($ch); var_dump($status); curl_close($ch); return $data; 
  • If you are trying to imitate browser actions with cURL, then maybe you had better take a browser? With Webdriver (he has clients for a number of languages). And programmatically get the information you need. - D-side
  • Take in the hands of wireshark or analogs and compare your requests and browser. Look for the difference. It can be very thin. - KoVadim pm

0