Rasa X HTTP POST request receives complete web page instead of JSON object

As mentioned on this page, when you submit an HTTP POST request by using Rasa x REST API in the form of

{ "sender": "test_user", // sender ID of the user sending the message "message": "Hi there!" }

The response from Rasa Open Source will be a JSON body of bot responses, for example:

   [
      {"text": "Hey Rasa!"}, {"image": "http://example.com/image.jpg"}
    ]

However, I get some sort of React like code in the response which I don’t understand. I’m using Postman for sending HTTP POST request to Rasa x server.

The response code which I get is given below:

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />

<link rel="shortcut icon" href="/icons/favicon.ico" />

<link rel="apple-touch-icon" href="/icons/apple-touch-icon-57x57.png" />

<link rel="apple-touch-icon" sizes="72x72" href="/icons/apple-touch-icon-72x72.png" />

<link rel="apple-touch-icon" sizes="114x114" href="/icons/apple-touch-icon-114x114.png" />

<link rel="apple-touch-icon" sizes="144x144" href="/icons/apple-touch-icon-144x144.png" />

<script>

try{window.SERVER_DATA=__SERVER_DATA__}catch(_){}

</script>

<title>Rasa X</title>

<link href="/static/css/2.d0c6ce9d.chunk.css" rel="stylesheet">

<link href="/static/css/main.7023b552.chunk.css" rel="stylesheet">

</head>

<body>

<div id="root"></div>

<script>

!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],s=0,p=[];s<i.length;s++)a=i[s],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);p.length;)p.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={1:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{3:"70e4c134",4:"3c14816d",5:"f4ecee47",6:"a8e8b518"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,function(r){return e[r]}.bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="/",a.oe=function(e){throw console.error(e),e};var i=this["webpackJsonprasa-frontend"]=this["webpackJsonprasa-frontend"]||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([])

</script>

<script src="/static/js/2.fcd62e11.chunk.js"></script>

<script src="/static/js/main.44d7cb1c.chunk.js"></script>

</body>

</html>

I was using the wrong port number in the rest endpoint while requesting POST. Instead of http://localhost:5005/webhooks/rest/webhook, I was using port 5002 as It was used by Rasa X. I still don’t figure out why the port should be 5005 and not 5002. Port 5005 is used by a process named python.