but the server still rejects requests. For now im simply not specifying Cache-Control in the HTTP client's headers, any idea how I could fix this issue?
Here is a test script you can use to duplicate the issue,
import axios from 'axios'
import { cacheAdapterEnhancer } from 'axios-extensions'
const api = axios.create({
baseURL: 'https://api.scryfall.com/',
headers: {'Cache-Control': 'no-cache'},
adapter: cacheAdapterEnhancer(axios.defaults.adapter, true)
})
export async function searchCards(query) {
return new Promise((resolve, reject) => {
api.get(`cards/search?q=${query}&pretty=true`).then((res) => {
resolve(res.data.data)
}).catch((e) => {
reject(e)
})
})
}
let cards
try {
cards = await searchCards('wizard')
console.log(cards)
} catch(e) {
console.log(e)
}
I've ran into this error when specifying the headers option to include 'Cache-Control no-cache' as specified in the readme.
The API server in question is
https://api.scryfall.com
, I tried some suggested workarounds online like specifying the following extra headers,but the server still rejects requests. For now im simply not specifying Cache-Control in the HTTP client's headers, any idea how I could fix this issue?
Here is a test script you can use to duplicate the issue,