WebResponse interface
Framework-agnostic response surface used by the hosting layer.
Remarks
This interface describes the minimal subset of an HTTP response object that
CloudAdapter.process and authorizeJWT need at runtime. Any framework whose
response object structurally satisfies this shape is compatible — including
Express's Response, and adapter classes such as FastifyReplyAdapter from
@microsoft/agents-hosting-fastify.
Keeping this contract in the core hosting package means the hosting layer no
longer needs to import types from express at compile time.
Properties
| headers |
Indicates whether response headers have been sent. |
| writable |
Indicates whether the response stream has ended. |
Methods
| end() | Ends the response. |
| send(unknown) | Sends an optional response body. |
| set |
Sets a response header. |
| status(number) | Sets the HTTP status code. |
Property Details
headersSent
Indicates whether response headers have been sent.
headersSent: boolean
Property Value
boolean
writableEnded
Indicates whether the response stream has ended.
writableEnded: boolean
Property Value
boolean
Method Details
end()
Ends the response.
function end(): this
Returns
this
send(unknown)
Sends an optional response body.
function send(body?: unknown): this
Parameters
- body
-
unknown
Returns
this
setHeader(string, string)
Sets a response header.
function setHeader(name: string, value: string): this
Parameters
- name
-
string
- value
-
string
Returns
this
status(number)
Sets the HTTP status code.
function status(code: number): this
Parameters
- code
-
number
Returns
this