Skip to content

v0.2.2

Latest

Choose a tag to compare

@ianhalpern ianhalpern released this 11 Dec 01:30
v0.2.2
c10cb15

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 headers configuration 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

Full Changelog

v0.2.1...v0.2.2