Open blesswarrior opened 3 years ago
正确响应的情况
$ch = curl_init(); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, 'https://fees.uspto.gov/mntfee-services/v1/maintenancefee/details?patentNumber=8690232&applicationNumber=13869358'); curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . "/cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . "/cookies.txt"); $result = curl_exec($ch); dump($result);
未能正确响应
$response = SaberGM::get('https://fees.uspto.gov/mntfee-services/v1/maintenancefee/details?patentNumber=8690232&applicationNumber=13869358'); dump($response->getStatusCode()); dump($response->getBody()->getContents());
经过2次跳转后,正常结果应该是json文本。
正确响应的情况
未能正确响应
经过2次跳转后,正常结果应该是json文本。