17/10/29 11:31:50.57 htd7uCcc0.net
>>798
private function request($url, $context = null) {
$http_request_header = null;
if (!$context) {
$cookie = $this->getCookie($url);
$context = [
'http' => [
'method' => 'GET',
'protcol_version' => 1.1,
'ignore_errors' => true,
'header' => 'Host: ' . parse_url($url)['host'] . "\r\n",
'Cookie: ' . $cookie . "\r\n",
"Connection: close\r\n"
]
];
$body = file_get_contents($url, false, stream_context_create($context));
$this->setCookie($url, $http_response_header);
return [$http_response_header, $body];
}
こんな感じです。