title: How to fix "11200 HTTP retrieval failure error" in Twilio Programmable SMS(WhatsApp)
body: <p>I want to understand what gives rise to the 11200 HTTP retrieval error? I've sent the response to the POST request to DialogFlow, shouldn't it be handling sending this response to Twilio?</p>
  
  <h1>Here's what I've done until now</h1>
  
  <p>I've setup a local python server, and exposed the localhost using a ngrok. The idea is to create a weather bot using Twilio Programmable SMS. The initial message to Twilio is forwarded to DialogFlow, which then sends a post request to my python server. I then process this request, and get the relevant weather information from OpenWeatherMap API. Being relatively new to server dev, I assume I then need to send a response with the right structure as mentioned in the DialogFlow guidelines (include fulfillmentText parameter for eg.) back to DialogFlow, which then should send the response to Twilio and that should show up on my WhatsApp Twilio Sandbox.
  ** But what I get is a 11200 HTTP retrieval failure error in the Twilio Degugger, I wanted to understand if I'm sending the Data to DialogFlow correctly and what gives rise to this error** I read the documentation for the error on Twilio's website but that didn't help me much in understanding the problem in my case.</p>
  
  <p>I had tried the same program using a PHP server, and it worked perfectly fine. I just wanted to recreate the program using a Python server, since I'm more comfortable using it for the time being.</p>
  
  <p>// DO post method of webhook.py </p>
  
  <pre><code>def do_POST(self):
      try:
          content_len = int(self.headers.get('Content-Length'))
          post_body = self.rfile.read(content_len)
  
          requestjson = json.loads(post_body)
          city = requestjson["queryResult"]["parameters"]["geo-city"]
          if city:
              print(city)
              info = getWeatherInformation(city)
              print(info) # Prints temp in city and weather condition successfully
              self.send_response(200)
              self.wfile.write(info.encode(encoding = "utf_8"))
  </code></pre>
  
  <h3>info variable is returned in the following manner from getWeatherInformation</h3>
  
  <pre><code>res = {"fulfillmentText":response}
  info = json.dumps(res)
  return info
  </code></pre>
  
  <h3>Console debug statements for city Melbourne</h3>
  
  <pre><code>Web Server running on port: 8080
  Melbourne
  {"fulfillmentText": "It is 31.29 degrees with clear sky"}
  127.0.0.1 - - [27/Jan/2019 23:00:34] "POST /webhook.py HTTP/1.1" 200 -
  </code></pre>
  
  <h3>PHP Webhook code from a blog post that works correctly</h3>
  
  <p>/
  * Part of the code that sends weather data response to Dialogflow
  */</p>
  
  <pre><code>function sendFulfillmentResponse($temperature, $weatherDescription)
  {
     $response = "It is $temperature degrees with $weatherDescription";
  
     $fulfillment = array(
         "fulfillmentText" =&gt; $response
     );
  
     echo(json_encode($fulfillment));
  }
  </code></pre>
  
  <p>I expect to see a response from the Twilio Sandbox account on WhatsApp, similar to when I created the server using PHP. Instead I get the 11200 error in Twilio Debugger, but no errors in the Server Terminal.</p>