relaton / relaton-doi

Relaton-DOI: retrieve bibliographic items using DOI
MIT License
0 stars 0 forks source link

Consider switch to the "Content negotiation API" for stability #19

Open ronaldtse opened 1 month ago

ronaldtse commented 1 month ago

Perhaps we should switch to the "Content negotiation API", it seems more stable:

Originally posted by @ronaldtse in https://github.com/relaton/relaton-doi/issues/18#issuecomment-2141160145

ronaldtse commented 1 month ago

Add an adapter?

ronaldtse commented 1 month ago

The Serrano gem supports the content negotiation API.

andrew2net commented 1 month ago

@ronaldtse as I see Content Negotiation is just a way to specify response format, not a separate API. I implemented polite API with request retrying and using X-Rate-Limit-Interval. It seems that Serrano doesn't use the X-Rate-Limit-Interval to retry failed requests and doesn't provide headers to get X-Rate-Limit-Interval. So I give up Serrano and moved to Faraday.