title: Ajax Request in Typo3 v10: Calling controller action via typeNum
body: <p>I am trying to call an Extbase controller action via Javascript/Ajax.
  The version is Typo3 v10. The controller action is supposed to return JSON.</p>
  <p>I have created the controller and the action as follows:</p>
  <pre><code>namespace Thevendor\Theextension\Controller;
  use Psr\Http\Message\ResponseFactoryInterface;
  use Psr\Http\Message\ServerRequestInterface;
  use TYPO3\CMS\Core\Http\Response;
  
  class ExampleController
  {
     /** @var ResponseFactoryInterface */
     private $responseFactory;
  
     public function __construct(ResponseFactoryInterface $responseFactory)
     {
        $this-&gt;responseFactory = $responseFactory;
     }
    
      public function doSomethingAction(ServerRequestInterface $request): Response
      {       
         error_log(&quot;controller action got called!&quot;);
         $data = ['result' =&gt; 42];
         $response = $this-&gt;responseFactory-&gt;createResponse()
            -&gt;withHeader('Content-Type', 'application/json; charset=utf-8');
         $response-&gt;getBody()-&gt;write(json_encode($data));
         return $response;    
      }
  }
  </code></pre>
  <p>Next, I have registered a plugin in ext_localconf.php:</p>
  <pre><code>\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
              'Thevendor.Theextension',
              'Testing',
              [
                  \Thevendor\Theextension\Controller\ExampleController::class =&gt; 'doSomething',               
              ],
              // non-cacheable actions
              [
                  \Thevendor\Theextension\Controller\ExampleController::class =&gt; 'doSomething',
              ]
          );
  </code></pre>
  <p>Next, I have created a file /theextension/Configuration/Typoscript/setup.typoscript that looks like this:</p>
  <pre><code>example_page = PAGE
  example_page {
      typeNum = 776776
  
      config {
          disableAllHeaderCode = 1
          additionalHeaders = Content-type:application/json
          xhtml_cleaning = 0
          debug = 0
          no_cache = 1
          admPanel = 0
      }
      10 &lt; plugin.theextension_testing        
  }
  </code></pre>
  <p>I am testing this by accessing the following URL in the browser and in Postman:</p>
  <p><em>/home?no_cache=1&amp;pagetype=776776&amp;tx_theextension_testing%5Baction%5D=doSomething&amp;tx_theextension_testing%5Bcontroller%5D=Example&amp;type=776776&amp;cHash=f63ebddb3625ec605e51b6ba07cf0731</em></p>
  <p>The response is 200 OK and empty. The line &quot;error_log&quot; in my controller action is not called.
  If I change the last line of my TypoScript to:</p>
  <pre><code>10 = TEXT
  10.value = ExampleText
  </code></pre>
  <p>I do get &quot;ExampleText&quot; returned. So the TypoScript definition, typeNUM and resulting above URL are working, but I cannot get it to call the controller action. I have also tried:
  10 &lt; tt_content.list.20.theextension_testing
  but the result was the same.</p>
  <p>Can anybody help pointing me in the right direction?
  I really appreciate your help.</p>