简体   繁体   English

为什么此API请求出现500错误

[英]Why am I getting a 500 error for this api request

I am trying top use guzzle to get data from https://idf.intven.com/public_patents . 我正在尝试使用guzzle从https://idf.intven.com/public_patents获取数据。 The page loads data with AJAX by making request to https://idf.intven.com/public_patent_listing.json . 该页面通过向https://idf.intven.com/public_patent_listing.json发出请求来使用AJAX加载数据。

I am working on a another site for them that they want to use this data for so I am trying to grab this data with guzzle but I keep getting 500 errors. 我正在为他们在另一个站点上工作,他们想使用此数据,因此我正努力抓住这些数据,但我不断收到500个错误。

    $this->client = new Client();
    $this->client->post( 'https://idf.intven.com/public_patent_listing.json', [
        'verify' => false,
        'json'    => [
        "report_type" => "public_patent_listing",
        "queryFields" => [],
        "filters" => [],"per_page" => 16,
        "from" => 0,
        "sort" => "issued_on",
        "sort_order" => "desc"
        ],
    ]);

Maybe because you are using arrays instead of json objects. 可能是因为您使用的是数组而不是json对象。 Change the square brackets to curly ones for main object and json object in it 将其中的主要对象和json对象的方括号更改为大括号

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM