SkitHttpConfig class

origin: opencode-go/glm-5.2 (new, D6 configurable design) author: anovsiradj, opencode-go/glm-5.2 version: 2026-08-17

Configurable HTTP layer. Accommodates Laravel _method spoofing + generic REST. Pass a custom SkitHttpConfig to httpApi* calls, or set defaultConfig globally.

Constructors

SkitHttpConfig({required String baseUrl, Map<String, String> defaultHeaders = const {'X-Requested-With' : 'XMLHttpRequest'}, Map<String, dynamic> defaultParams = const {}, bool methodSpoofing = false, String? tokenProvider()?, String tokenParamKey = 'token', Duration timeout = const Duration(seconds: 30)})
const

Properties

baseUrl → String
final
defaultHeaders → Map<String, String>
final
defaultParams → Map<String, dynamic>
final
hashCode → int
The hash code for this object.
no setterinherited
methodSpoofing → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → Duration
final
tokenParamKey → String
final
tokenProvider → String? Function()?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromEnv() → SkitHttpConfig
Default config derived from env APP_API_URL (Laravel convention). Override via defaultConfig = ... at bootstrap.