Good day. Engaged in writing an API for someone else's site (order). But I can not send cURL POST. There is such a code.

$cookie = send_post_get_cookie("https://www.interpals.net/app/auth/login"); if( $curl = curl_init() ) { curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, 'https://www.interpals.net/app/auth/login'); curl_setopt ($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_COOKIE, $cookie); $headers = [ 'X-Apple-Tz: 0', 'X-Apple-Store-Front: 143444,12', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Encoding: gzip, deflate', 'Accept-Language: en-US,en;q=0.5', 'Cache-Control: no-cache', 'Content-Type: application/x-www-form-urlencoded; charset=utf-8', 'Host: www.interpals.net', 'Referer: https://www.interpals.net/app/auth/login', //Your referrer address 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0', 'X-MicrosoftAjax: Delta=true' ]; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POSTFIELDS,"username={$login}&password={$password}&csrf_token=$csrf_token"); $out = curl_exec($curl); curl_close($curl); } 

All parameters copied from the Network tab in Chrome. After sending, the server returns:

 <body> Redirecting to <a href="/">/</a>. <script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","licenseKey":"651b103a3b","applicationID":"17278031,27395599","transactionName":"MlNbN0FRWkVZAUALCwsZehZARFtbFyNBFgxfDFUMVFla","queueTime":0,"applicationTime":14,"atts":"HhRYQQlLSUs=","errorBeacon":"bam.nr-data.net","agent":""}</script></body> </html> 

And I must return the error page, or a personal account.

Please help. Thank you in advance.

  • Watch carefully in the browser what happens when you login. Either another redirect occurs, or some JS code is executed - Anton Shchyrov
  • Before login there is another script with wss: //ws.interpals.net/socket/292/ny1pdxjg/websocket What to do with it? - Wheelys
  • 3
    Well, see what this script does. I can't see from here - Anton Shchyrov

0