ProtectedactingProtectedauthProtectedbodyProtected ReadonlyhostProtectedlocaleProtected ReadonlymethodProtected ReadonlymoduleProtected ReadonlypathProtectedrequestProtected StaticgetterNames registered via getter() — used by hasMacro() and flushMacros().
Protected StaticinstancePer-instance properties. Each entry is applied and bound
to this inside the constructor so destructuring stays safe.
Protected StaticmacroNames registered via macro() — used by hasMacro() and flushMacros().
Authenticate the request as a specific user
ProtectedapplySet Content-Type to application/json
Send the request and return response
Calls module.fetch() - NOT SELF.fetch()
Set the request body
Add headers to the request
Set the locale for this request. If strategy is not provided, resolves from the module's I18n configuration.
Locale code (e.g., 'en', 'fr')
Optionalstrategy: DetectionStrategyDetection strategy override
StaticflushRemove all macros, instance properties, and getters registered on this class. Does not affect parent classes.
StaticgetterRegister a computed getter on the class prototype.
Register a computed getter on the class prototype.
Property name
Function that computes the value (called with instance as this)
Optionalsingleton: booleanIf true, cache the value after first access
StatichasCheck if a macro, instance property, or getter is registered.
Name to check
StaticinstanceRegister a per-instance property that is bound to this
in the constructor. Safe for destructuring.
When the name matches an existing property, the value type is auto-derived.
Register a per-instance property that is bound to this
in the constructor. Safe for destructuring.
When the name matches an existing property, the value type is auto-derived.
Property name
Function (will be bound) or value
StaticmacroRegister a macro on the class prototype. Can override existing methods.
When the name matches an existing property, the value type is auto-derived.
Register a macro on the class prototype. Can override existing methods.
When the name matches an existing property, the value type is auto-derived.
Method or property name
Function or value to assign
TestHttpRequest
Request builder with fluent API for configuring test HTTP requests.
Example
Example: Authenticated request