Write-KrBsonResponse
SYNOPSIS
Writes an object serialized as BSON to the HTTP response.
SYNTAX
__AllParameterSets
Write-KrBsonResponse [-InputObject] <Object> [[-StatusCode] <int>] [[-ContentType] <string>]
[<CommonParameters>]
ALIASES
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION
Converts the provided object to BSON format and writes it to the response body. The status code and content type can be customized.
EXAMPLES
EXAMPLE 1
Write-KrBsonResponse -InputObject $myObject -StatusCode 200 -ContentType “application/bson” Writes the $myObject serialized as BSON to the response with a 200 status code and content type “application/bson”.
PARAMETERS
-ContentType
The content type to set for the response. If not specified, defaults to application/bson.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-InputObject
The object to serialize and write to the response.
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-StatusCode
The HTTP status code to set for the response. Defaults to 200.
Type: System.Int32
DefaultValue: 200
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
System.Object
{{ Fill in the Description }}
OUTPUTS
NOTES
This function is designed to be used in the context of a Kestrun server response.
RELATED LINKS
{{ Fill in the related links here }}