If-None-Match: "1872ade88f3013edeb33decd74a4f947"ĭepending on whether or not your result set has updated since your last API request, the API will return either: Moreover, you will need to add the If-Modified-Since HTTP header to your API request containing the date and time data from your last request. Once you make another API request, make sure to include the If-None-Match HTTP header abd set ut to your previously generated ETag value. This data must be cached along with the entire API response in order for ETags to work. Your initial request to the Fixer API will create an ETag object containing a unique ETag key and a Date object containing the exact date and time at which the data was last modified. (Definition by ) ETags - Quickstart Guide Step 1 If the ETag at the server has not changed, a "Not Modified" message is returned, and the cached data is used. Whenever a resource is requested (via its URL), the data and ETag are retrieved and stored in the Web cache, and the ETag is sent along with subsequent requests. The ETag is an identifier assigned to a data resource in a server, and if that resource is ever updated at the server, the ETag is changed. HTTP ETags are a way of reducing the load on your back-end by requesting new Fixer data only if rates have changed since the last API response.Īn ETag is a part of the HTTP protocol and one of the several mechanisms used for cache validation. All data is returned in standard JSON format and can be parsed easily using any programming language.Įxample Response: Below you will find an example API response carrying a number of common world currencies, all relative to the currency EUR and time stamped at the exact time they were collected.Īs illustrated above, the API's response - when queried for real-time exchange rates - always contains a timestamp object containing a standard UNIX time stamp indicating the time the given exchange rate data was collected, a base object containing the three-letter currency code of the base currency, a date object containing the date the given exchange rate data was collected, and a rates object containing the actual exchange rate data.įurther below, in the Endpoints section, the API response structure will be discussed in detail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |