我试图在我的STEAM帐户上自动接受交易,我已经成功登录并且一切都很好,这让我希望我可以远程联系服务器,同时我保留了登录cookie关于使用cURL饼干罐。 这是我的cURL代码:
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$url = "https://steamcommunity.com/tradeoffer/957#######/accept/";
$params = [
'sessionid' => "71824XXXXXXXXXXXX" ,
'tradeofferid' => ########,
'serverid' => #,
'partner' => ##############
];
$cookie_jar = 'C:\Windows\Temp\cooC0B3.tmp';
$session = curl_init($url);
curl_setopt($session, CURLOPT_COOKIEJAR, $cookie_jar);
curl_setopt($session, CURLOPT_COOKIEFILE, $cookie_jar);
curl_setopt($session, CURLOPT_HEADER, 1);
curl_setopt($session, CURLINFO_HEADER_OUT, true);
curl_setopt($session, CURLOPT_VERBOSE, 1);
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($session, CURLOPT_CONNECTTIMEOUT ,0);
curl_setopt($session, CURLOPT_TIMEOUT, 400);
curl_setopt($session, CURLOPT_USERAGENT, $userAgent);
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($session);
$response2 = curl_getinfo($session, CURLINFO_HEADER_OUT );
print_r($response);
用户代理设置为我当前使用的Chrome浏览器,会话ID是存储在cookieJAR中的会话ID。
请注意,我尝试在真实帐户登录时检查和编辑html脚本,我创建了一个表单,通过输入字段Method="POST" action="<previous accept trade url>"
发送以前的参数并成功接受。