I'm trying to use an API with wp_remote_get which requires pagination.
Currently, my WordPress plugin calls the API the following way
$response = wp_remote_get( "https://api.xyz.com/v1/products" ,
array( 'timeout' => 10,
'headers' => array(
'Authorization' => 'Bearer xyz',
'accept' => 'application/json',
'content-type' => 'application/json'
)
));
$body = wp_remote_retrieve_body( $response );
return json_decode($body);
Now, if I change the URL from /products to /products?page_size=5&page=2, which works fine in Postman and other programs, i am not getting a response. Why is that? I checked the API documentation of wp_remote_get but am not figuring it out.