drpitman / PHP-Xero

A php class to interact with the Xero API
29 stars 73 forks source link

If Modified since issue #6

Open eileenmcnaughton opened 14 years ago

eileenmcnaughton commented 14 years ago

Hi

Your If Modified since header wasn't working - this is what works for me ie, set HEADER to True & Set HTTPHEADER to the value required:

        if ( $modified_after ) {
            curl_setopt($ch, CURLOPT_HTTPHEADER, array("If-Modified-Since: $modified_after"));
        }
        curl_setopt($ch, CURLINFO_HEADER, 1);
unifonenz commented 13 years ago

not sure if i would put curl_setopt($ch, CURLINFO_HEADER, 1); as it will display the headers when returned, you just need curl_setopt($ch, CURLOPT_HTTPHEADER, array("If-Modified-Since: $modified_after"));

unifonenz commented 13 years ago

i also have never heard of CURLINFO_HEADER, did you mean CURLOPT_HEADER?