情况
我正在尝试调用Shopify REST API,其中有超过 50-250 个结果,但我无法从包含Pagination Links 的cURL Response 中获取链接标头。
Cursor-Pagination API 文档中的链接标头示例( https://shopify.dev/tutorials/make-paglated-requests-to-rest-admin-api )
#...
Link: "<https://{shop}.myshopify.com/admin/api/{version}/products.json?page_info={page_info}&limit={limit}>; rel={next}, <https://{shop}.myshopify.com/admin/api/{version}/products.json?page_info={page_info}&limit={limit}>; rel={previous}"
#...
Run Code Online (Sandbox Code Playgroud)
链接rel参数确实显示,但链接为空,如下所示。
我的 Shopify 通话功能
function shopify_call($token, $shop, $api_endpoint, $query = array(), $method = 'GET', $request_headers = array()) {
// Build URL
$url = "https://" . $shop . ".myshopify.com" . $api_endpoint;
if (!is_null($query) && in_array($method, array('GET', 'DELETE'))) $url = $url . "?" . http_build_query($query);
$headers = [];
// Configure cURL
$curl …Run Code Online (Sandbox Code Playgroud)