Write PodeTextResponse - mdaneri/Pode GitHub Wiki
external help file: Pode-help.xml Module Name: Pode online version: PodeType: Responses schema: 2.0.0
Writes a String or a Byte[] to the Response.
Write-PodeTextResponse [[-Value] <String>] [-ContentType <String>] [-MaxAge <Int32>] [-StatusCode <Int32>]
[-Cache] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Write-PodeTextResponse [-Bytes <Byte[]>] [-ContentType <String>] [-MaxAge <Int32>] [-StatusCode <Int32>]
[-Cache] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Writes a String or a Byte[] to the Response, as some specified content type. This value can also be cached.
Write-PodeTextResponse -Value 'Leeeeeerrrooooy Jeeeenkiiins!'
Write-PodeTextResponse -Value '{"name": "Rick"}' -ContentType 'application/json'
Write-PodeTextResponse -Bytes (Get-Content -Path ./some/image.png -Raw -AsByteStream) -Cache -MaxAge 1800
Write-PodeTextResponse -Value 'Untitled Text Response' -StatusCode 418
An array of Bytes to write.
Type: Byte[]
Parameter Sets: Bytes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShould the value be cached by browsers, or not?
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe content type of the data being written.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Text/plain
Accept pipeline input: False
Accept wildcard characters: FalseThe maximum age to cache the value on the browser, in seconds.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 3600
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe status code to set against the response.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 200
Accept pipeline input: False
Accept wildcard characters: FalseA String value to write.
Type: String
Parameter Sets: String
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.