I use Guzzle to retrieve API from server API url and i want to fetch the data and using pagination.
I try these:
$request_url="http://192.168.0.1:8081/APIServer/public/api/products";
$client = new GuzzleHttpClient();
$response = $client->request('GET', $request_url, [
'headers' => ['Accept' => 'application/xml',
'Authorization' => 'Bearer ' . $token,
'Content-Type' => 'application/json'
],
'timeout' => 120
])->getBody()->getContents();
$responseXml = simplexml_load_string($response);
$responseArray = json_decode(json_encode($responseXml), true);
return view('dashboard')->with(array('data'=>$responseArray['stdClass']));
How can i use pagination with guzzle?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…