Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

$response.Json

Tyler James Leonhardt edited this page Nov 11, 2017 · 3 revisions

Sets the content of the response.

This modifies the ContentType but does not modify the StatusCode. They will be set to:

ContentType: "application/json" StatusCode: 200

Example:

New-GetRoute -Path "/helloworld" -ScriptBlock {
    $json = @{ wow = "hey" }

    $response.Json((ConvertTo-Json $json));
}
Clone this wiki locally