I have followed "Fetch Only Modified Resources"
http://developer.simprogroup.com/apidoc/?page=07adc9c3c19b7c17e7309e86c22161a2#tag/Fetch-only-modified-resources
As you have mentioned into doc that :-
You can simply copy this and send it as a header in your next request.
GET /api/v1.0/companies/0/jobs/
If-Modified-Since: Wed, 30 May 2018 12:00:00 GMT
So to use this my code is given below:-
array('If-Modified-Since' => $modify_since));
$request = $provider->fetchRequest($cust_get_data_url,$method, $headers);
$response = $provider->fetchResponse($request);
//$response->setHeaders('If-Modified-Since:', $modify_since);
$statusCode = $response->getStatusCode();
echo "statusCode:-".$statusCode;
if(isset($statusCode) && $statusCode=== 200){
$result = json_decode((string)$response->getBody(),true);
if(isset($result) && sizeof($result)){
$data_result = $result;
echo "
";
print_r($data_result);
echo "
";
}
}
}catch(Exception $e) {
//echo '
'.__LINE__;print_R($e);
echo $e->getMessage();
}
?>
But this is not giving me data according to modify since but when I test it into POSTMAN its working fine.
So please let me know how to set header for "If-Modified-Since" into request.
Efforts will be appreciated if you will send an complete example for this.
Thanks
I have followed "Fetch Only Modified Resources"
http://developer.simprogroup.com/apidoc/?page=07adc9c3c19b7c17e7309e86c22161a2#tag/Fetch-only-modified-resources
As you have mentioned into doc that :-
array('If-Modified-Since' => $modify_since)); $request = $provider->fetchRequest($cust_get_data_url,$method, $headers); $response = $provider->fetchResponse($request); //$response->setHeaders('If-Modified-Since:', $modify_since); $statusCode = $response->getStatusCode(); echo "statusCode:-".$statusCode; if(isset($statusCode) && $statusCode=== 200){ $result = json_decode((string)$response->getBody(),true); if(isset($result) && sizeof($result)){ $data_result = $result; echo ""; } } }catch(Exception $e) { //echo 'You can simply copy this and send it as a header in your next request.
GET /api/v1.0/companies/0/jobs/
If-Modified-Since: Wed, 30 May 2018 12:00:00 GMT
So to use this my code is given below:-