Hi,
According to https://opendata.transport.nsw.gov.au/node/326/exploreapi#!/sydneytrains/SydneyTrains
there should be a Last-Modified header.
The HEAD operation can be used to tell you if the content has changed (as GET may not return an HTTP 304 when no content has changed.)
For example, you may compare the Last-Modified header retrieved during a HEAD operation with the Last-Modified header retrieved during a previous GET operation. If the headers are the same, the content has not changed since the previous GET operation. If the headers are different, the content has changed since the previous GET operation.
I haven’t gotten that header on any request I make. Am I doing something wrong or is the header missing?
See below for sample request.
GET Request:
GET https://api.transport.nsw.gov.au/v1/gtfs/alerts/sydneytrains HTTP/1.1
Authorization: apikey [REDACTED]
Host: api.transport.nsw.gov.au
Response:
HTTP/1.1 200 OK
Date: Fri, 27 Apr 2018 12:46:46 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: [REDACTED] Expires=Fri, 04 May 2018 12:46:46 GMT; Path=/
Server: Apache-Coyote/1.1
Cache-Control: private
Expires: Thu, 01 Jan 1970 10:00:00 AEST
Strict-Transport-Security: max-age=63072000
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
[DATA]
HEAD Request:
HEAD https://api.transport.nsw.gov.au/v1/gtfs/alerts/sydneytrains HTTP/1.1
Authorization: apikey [REDACTED]
Host: api.transport.nsw.gov.au
Response:
HTTP/1.1 200 OK
Date: Fri, 27 Apr 2018 12:47:49 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: [REDACTED] Expires=Fri, 04 May 2018 12:47:49 GMT; Path=/
Server: Apache-Coyote/1.1
Cache-Control: private
Expires: Thu, 01 Jan 1970 10:00:00 AEST
Strict-Transport-Security: max-age=63072000
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Best Regards,
Johan