
消息
|
119
$context = $httpServer.GetContext()
if ($context.Request.HttpMethod -eq 'GET' -and $context.Request.RawUrl
-eq '/dapr/subscribe') {
$buffer = [System.Text.Encoding]::UTF8.GetBytes("[{topic: 'A',
route: '/A']")
$context.Response.ContentLength64 = $buffer.Length
$context.Response.ContentType = "application/json"
$context.Response.OutputStream.Write($buffer, 0, $buffer.Length)
$context.Response.OutputStream.Close()
}
if ($context.Request.HttpMethod -eq 'POST' -and $context.Request.RawUrl
-eq '/A') {
$length = $context.Request.ContentLength64
$buffer = [System.Byte[]]::CreateInstance([System.Byte],$length) ...