// APIのURL $url = 'https://qiita.com/api/v1/auth'; // Qiitaユーザ名とパスワード $data = array( 'url_name' => $params['uid'], 'password' => $params['pwd'], ); // HTTPヘッダの内容(※ここがかなり重要っぽい) $headers = array( 'Content-Type: application/x-www-form-urlencoded', ); // コンテキストリソース $options = array( 'http' => array( 'method' => 'POST', 'content' => http_build_query($data), 'header' => implode("\r\n", $headers), ) ); $