| external help file | Pretendpoint.dll-Help.xml |
|---|---|
| Module Name | Pretendpoint |
| online version | https://docs.microsoft.com/dotnet/api/system.net.httplistener |
| schema | 2.0.0 |
Sends a text or binary response body to the HTTP listener client.
Write-WebResponse [-Response] <HttpListenerResponse> [-Body <Object>] [-Encoding <String>]
[-ContentType <String>] [-StatusCode <HttpStatusCode>] [<CommonParameters>]
{{ Fill in the Description }}
'Success' |Write-WebResponse $httpContext.Response
Sends the string "Success" to the HTTP listener client as text/plain.
ConvertTo-Json $data |Write-WebResponse $httpContext.Response -ContentType application/json
Sends the JSON data to the HTTP listener client.
The HTTP response to send through.
Type: HttpListenerResponse
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSets the content type of the response body.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSets an encoding for the response body.
Type: String
Parameter Sets: (All)
Aliases: Outcoding
Accepted values: ascii, utf16, utf16BE, utf32, utf32BE, utf7, utf8
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseData to send as a response body.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSets the HTTP response status code.
Type: HttpStatusCode
Parameter Sets: (All)
Aliases:
Accepted values: Continue, SwitchingProtocols, Processing, EarlyHints, OK, Created, Accepted, NonAuthoritativeInformation, NoContent, ResetContent, PartialContent, MultiStatus, AlreadyReported, IMUsed, MultipleChoices, Ambiguous, MovedPermanently, Moved, Found, Redirect, SeeOther, RedirectMethod, NotModified, UseProxy, Unused, TemporaryRedirect, RedirectKeepVerb, PermanentRedirect, BadRequest, Unauthorized, PaymentRequired, Forbidden, NotFound, MethodNotAllowed, NotAcceptable, ProxyAuthenticationRequired, RequestTimeout, Conflict, Gone, LengthRequired, PreconditionFailed, RequestEntityTooLarge, RequestUriTooLong, UnsupportedMediaType, RequestedRangeNotSatisfiable, ExpectationFailed, MisdirectedRequest, UnprocessableEntity, Locked, FailedDependency, UpgradeRequired, PreconditionRequired, TooManyRequests, RequestHeaderFieldsTooLarge, UnavailableForLegalReasons, InternalServerError, NotImplemented, BadGateway, ServiceUnavailable, GatewayTimeout, HttpVersionNotSupported, VariantAlsoNegotiates, InsufficientStorage, LoopDetected, NotExtended, NetworkAuthenticationRequired
Required: False
Position: Named
Default value: None
Accept pipeline input: False
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.