0
我已经做到了这一点:如何使用卷曲的请求JSON登录到远程站点
<?php
$post_body = '{"login": "injoit", "password": "injoit"}';
$cookie_file = tempnam('/temp', 'cookie');
$ch = curl_init('remote server login here');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_body);
curl_exec($ch);
我得到这个响应:Failed to connect to "remote server url here" port 8002: Connection timed out(7)
还需要给' curl_setopt($ ch,CURLOPT_COOKIEJAR,$ CookieJarFilename);' 保存远程服务器为您提供的客户端会话ID –
@ Santa'shelper感谢您的提醒 – jaxon
我编辑了我的问题作为你的答案。但仍然没有工作。请帮忙 – Aashi