Release Notes
🚀 Features
Default Headers Support in Session (#6)
Added the ability to configure default headers at the Session level that will be automatically applied to all requests made within that session. This allows for cleaner code when working with APIs that require consistent headers across multiple requests.
What's New
- Session instances now support a
headersconfiguration option - Default headers are automatically merged with request-specific headers
- Request-level headers take precedence over session defaults
- Comprehensive test coverage for the new functionality
Usage Example
import Armrest from '@armrest/client'
const API = new Armrest('http://armrest-api-url')
.model('Example')
const api = API.Session('api-key', {
headers: {
'X-Custom-Header': 'value',
'User-Agent': 'MyApp/1.0'
}
})New Contributors
- @russellw-dev made their first contribution in #6