title: Send CURL commands and retrieve responses from a Flask page
body: <p>When I launch this command:</p>
  
  <pre><code>$python -m rasa_core.server 
  -d &lt;DIALOGUE_MODEL_PATH&gt; 
  -u &lt;NLU_MODEL_PATH&gt; 
  --debug 
  -o out.log 
  --cors *
  </code></pre>
  
  <p>I get the following expected results when I use the terminal for curl -XPOST commands.</p>
  
  <pre><code>$ curl -XPOST localhost:5005/conversations/default/respond -d '{"query":"Hello"}'
  [{"recipient_id": "default", "text": "Hello! How can I help?"}]
  </code></pre>
  
  <p>And the server seems to work well:</p>
  
  <pre><code>2018-06-06 09:28:14+0100 [-] 2018-06-06 09:28:14 DEBUG    rasa_core.tracker_store  - Creating a new tracker for id 'default'.
  2018-06-06 09:28:15+0100 [-] /home/mike/Programing/Rasa/myflaskapp/myFlaskAppenv/lib/python3.5/site-packages/sklearn/preprocessing/label.py:151: builtins.DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size &gt; 0` to check that an array is not empty.
  2018-06-06 09:28:15+0100 [-] 2018-06-06 09:28:15 DEBUG    rasa_core.processor  - Received user message 'I am sad' with intent '{'name': 'inform', 'confidence': 0.9091038037055945}' and entities '[{'start': 5, 'entity': 'mood', 'value': 'sad', 'extractor': 'ner_crf', 'end': 8, 'confidence': 0.5274867092381141}]'
  2018-06-06 09:28:15+0100 [-] 2018-06-06 09:28:15 DEBUG    rasa_core.processor  - Logged UserUtterance - tracker now has 3 events
  2018-06-06 09:28:15+0100 [-] 2018-06-06 09:28:15 DEBUG    rasa_core.processor  - Current slot values: 
  2018-06-06 09:28:15+0100 [-]    location: None
  2018-06-06 09:28:15+0100 [-]    adjective: None
  2018-06-06 09:28:15+0100 [-]    information: None
  2018-06-06 09:28:15+0100 [-]    mood: sad
  2018-06-06 09:28:15+0100 [-] 2018-06-06 09:28:15 DEBUG    rasa_core.policies.memoization  - Current tracker state [
  2018-06-06 09:28:15+0100 [-]    None
  2018-06-06 09:28:15+0100 [-]    None
  2018-06-06 09:28:15+0100 [-]    [('intent_inform', 1), ('entity_mood', 1), ('slot_mood_0', 1), ('prev_action_listen', 1)]]
  2018-06-06 09:28:15+0100 [-] 2018-06-06 09:28:15 DEBUG    rasa_core.policies.memoization  - Used memorised next action '9'
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'utter_sadness' with prob 1.00.
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.processor  - Bot utterance 'BotUttered(text: be a tough guy, data: null)'
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.processor  - Action 'utter_sadness' ended with events '[]'
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.policies.memoization  - Current tracker state [
  2018-06-06 09:28:19+0100 [-]    None
  2018-06-06 09:28:19+0100 [-]    [('intent_inform', 1), ('entity_mood', 1), ('slot_mood_0', 1), ('prev_action_listen', 1)]
  2018-06-06 09:28:19+0100 [-]    [('intent_inform', 1), ('entity_mood', 1), ('slot_mood_0', 1), ('prev_utter_sadness', 1)]]
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.policies.memoization  - Used memorised next action '0'
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_listen' with prob 1.00.
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
  2018-06-06 09:28:19+0100 [-] 2018-06-06 09:28:19 DEBUG    rasa_core.processor  - Current topic: None
  2018-06-06 09:28:19+0100 [-] "127.0.0.1" - - [06/Jun/2018:08:28:13 +0000] "POST /conversations/default/respond HTTP/1.1" 200 55 "-" "curl/7.47.0"
  </code></pre>
  
  <p>But when I try to send a message through the graphical interface I get an exception:</p>
  
  <pre><code>Expecting value: line 1 column 1 (char 0)
  127.0.0.1 - - [06/Jun/2018 09:33:46] "POST /chat HTTP/1.1" 200
  </code></pre>
  
  <p>And only this from the Rasa server terminal:</p>
  
  <pre><code>2018-06-06 09:41:14+0100 [-] "127.0.0.1" - - [06/Jun/2018:08:41:13 +0000] "GET /parse?q=Hi HTTP/1.1" 404 233 "-" "python-requests/2.18.4"
  </code></pre>
  
  <p>Here is the part of <a href="https://github.com/antoinecomp/myflaskapp/blob/master/app.py" rel="nofollow noreferrer"><code>app.py</code></a> that can be problematic, I think:</p>
  
  <pre><code>@app.route('/chat',methods=["POST"])
  def chat():
      try:
          user_message = request.form["text"]
          response = requests.get("http://localhost:5005/parse",params={"q":user_message})
          response = response.json()
          print("response :\n",response) 
          entities = response.get("entities")
          topresponse = response["topScoringIntent"]
          intent = topresponse.get("intent")
          print("Intent {}, Entities {}".format(intent,entities))
          if intent == "gst-info":
              response_text = gst_info(entities)# "Sorry will get answer soon" #get_event(entities["day"],entities["time"],entities["place"])
          elif intent == "gst-query":
              response_text = gst_query(entities)
          else:
              get_random_response = lambda intent:random.choice(intent_response_dict[intent])
              response_text = get_random_response(intent)
          return jsonify({"status":"success","response":response_text})
      except Exception as e:
          print("HOUSTON ! WE GOT AN EXCETPITON !")
          print(e)
          return jsonify({"status":"success","response":"Sorry I am not trained to do that yet..."})
  </code></pre>
  
  <p>** Therefore, I am only looking for the same answers obtained with the CURL command on the graphic page created by Flask. **</p>
  
  <p>At the moment I only get:</p>
  
  <p><a href="https://i.stack.imgur.com/J9fyS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J9fyS.png" alt="introducir la descripción de la imagen aquí"></a></p>