Methods
body(value) → {ProvideResponseParameters}
Sets the body value for the response parameters.
Parameters:
Name | Type | Description |
---|---|---|
value | BytesValue | The value to set as the body. Must be an instance of BytesValue. |
Throws:
- Throws an error if the value is not an instance of BytesValue.
- Type
- Error
Returns:
- Returns the ProvideResponseParameters object for chaining.
cookies(cookieHeaders) → {ProvideResponseParameters}
Sets the cookie headers for the response.
Parameters:
Name | Type | Description |
---|---|---|
cookieHeaders | Array.<Header> | An array of cookie headers. |
Throws:
- Throws an error if a cookie header is not an instance of Header.
- Type
- Error
Returns:
- Returns the ProvideResponseParameters object for chaining.
headers(headers) → {ProvideResponseParameters}
Sets the headers for the response.
Parameters:
Name | Type | Description |
---|---|---|
headers | Array.<Header> | The headers to be set. |
Throws:
- If the provided header is not an instance of Header.
- Type
- Error
Returns:
- Returns the ProvideResponseParameters object for chaining.
reasonPhrase(reasonPhrase) → {ProvideResponseParameters}
Sets the reason phrase for the response.
Parameters:
Name | Type | Description |
---|---|---|
reasonPhrase | string | The reason phrase to set. |
Throws:
- If the reason phrase is not a string.
- Type
- Error
Returns:
- Returns the ProvideResponseParameters object for chaining.
statusCode(statusCode) → {ProvideResponseParameters}
Sets the status code for the response.
Parameters:
Name | Type | Description |
---|---|---|
statusCode | number | The status code to set. |
Throws:
- If the status code is not an integer.
- Type
- Error
Returns:
- Returns the ProvideResponseParameters object for chaining.