Advanced
Setting Default Headers for JSON and Token Authorization
import { HttpClient } from '@aurelia/fetch-client';
const http = new HttpClient();
http.configure(config => {
config.withDefaults({
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': `Bearer YOUR_TOKEN_HERE`
}
});
});Response Caching
Simple Retry Logic on Network Failure
Last updated
Was this helpful?