1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Http\Controllers;
- use GuzzleHttp\Client;
- use Illuminate\Foundation\Bus\DispatchesJobs;
- use Illuminate\Routing\Controller as BaseController;
- use Illuminate\Foundation\Validation\ValidatesRequests;
- use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
- class SourceController extends BaseController
- {
- use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
- public function getSource()
- {
- $client = new Client();
- // $url = 'https://jzsc.mohurd.gov.cn/APi/webApi/dataservice/query/comp/list';
- $url = 'https://jzsc.mohurd.gov.cn/APi/webApi/dataservice/query/comp/list?complexname=%E5%9B%9B%E5%B7%9D%E9%A1%BA%E8%B5%90%E5%BB%BA%E7%AD%91%E5%8A%B3%E5%8A%A1%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&pg=0&pgsz=15&total=0';
- $header = [
- 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
- 'v' => 231012
- ];
- // $params = [
- // 'complexname' => '成都翔威建筑工程有限公司',
- // 'pg' => 0,
- // 'pgsz' => 15,
- // 'total' => 0
- // ];
- try {
- $res = $client->request('GET', $url, [
- 'headers' => ['User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36'],
- ]);
- } catch (\Exception $e) {
- dd($e);
- }
- dd($res);
- }
- }
|