Download actions for Extbase, the Topwire way
Create the download in your Extbase actions and let the action return the file type you want (json in this example).
If you then create a link to this action with Topwire's view helpers, then the download just works, without having to add a page type with your plugin within TypoScript.
Fluid
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:topwire="http://typo3.org/ns/Topwire/ViewHelpers"
data-namespace-typo3-fluid="true">
<topwire:context.plugin pluginName="Json">
<h3>Link to a download action in your plugin</h3>
<f:link.action
action="json"
class="btn btn-primary"
additionalParams="{topwire: {type: 'context'}}"
>
Download JSON
</f:link.action>
</topwire:context.plugin>
</html>
Link to any plugins using default view helpers