Forum Topic - FRCAPI Question on If-Modified-Since Header: (1 Item)
   
FRCAPI Question on If-Modified-Since Header  
I'm building a package in R (github.com/irwinsnet/firstapiR) for downloading and analyzing FIRST API server data. I am 
currently adding conditional update functionality to the package that uses the "If-Modified-Since" header. 

Question:
According to my testing, If I request data from the server using the "If-Modified-Since" header, and the value of the "
If-Modified-Since" header exactly matches the "Last-Modified" value, the server is returning the requested data (200 
response) instead of a 304 response indicating the data has not been updated. Is this intentional? 

It seems counter-intuitive. If I request data from the server, and store the value of the "Last-Modified" header as the 
apiary documentation suggests, and then return that exact same value to the server in the "If-Modified-Since" header, it
 seems I should
get a 304 response. Otherwise, if I want to reduce load on the server, my client would need to add a second to the "Last
-Modified" value before returning the value via the "If-Modified-Since" header -- which seems cumbersome. I can't help 
but wonder if this is an error, especially since the apiary documentation doesn't say anything about having to add a 
time interval to the "Last-Modified" value before returning it via "If-Modified-Since"

Details:
1. I requested data from the sever and recorded the value of the "Last-Modified" header. 
Request URL: "https://frc-api.firstinspires.org/v2.0/2016/schedule/WAELL?tournamentLevel=qual"
Last Modified Header returned from server: "Fri, 18 Mar 2016 08:27:07 GMT"

2. I requested data again from the sever using the same URL, but I put the date-time returned in step 1 ("Fri, 18 Mar 
2016 08:27:07 GMT") in the "If-Modified-Since" header. The server returned the entire schedule with status 200.

3. I added one second to the date-time and again called the same URL as in step 1, but with the revised date-time ("Fri,
 18 Mar 2016 08:27:08 GMT") in the "If-Modified-Since" header. The server gave me a 304 response. 

Thanks,

Stacy Irwin
FRC 1318
Issaquah Robotics Society