title: Parse Error: The server returned a malformed response - Error: Parse Error: Expected HTTP/ - when trying to access one of my app URLs with postman
body: <p>I am managing an app built by third parts in python.</p>
  <p>I have this url dispatcher</p>
  <pre><code>urls += [(r'/path/objectA/(.*)', ObjectAHandler)]  # this was made by third parts, it is expected to work
  </code></pre>
  <p>and this class</p>
  <pre><code>class ObjectAHandler(BaseHandler):
  
      def __init__(self, application, request, **kwargs):
          super(ObjectAHandler, self).__init__(application, request, **kwargs)  # do the init of the basehandler
  
      @gen.coroutine
      def post(self, action=''):
          response = {}
          
              ...     
              
              response = yield self.my_method(json_data)
          
              ... 
  
          self.write(json.dumps(response))
  
      def my_method(self, json_data)
          ...
  </code></pre>
  <p>I want to check that the app correctly receives the request and returns some response.</p>
  <p>So I try to access that url with Postman</p>
  <p>request type:</p>
  <pre><code>POST
  </code></pre>
  <p>URL:</p>
  <pre><code>http://&lt;machine_ip&gt;:&lt;machine_port&gt;/path/objectA/
  </code></pre>
  <p>I get this error from Postman response box</p>
  <blockquote>
  <p>Parse Error: The server returned a malformed response</p>
  </blockquote>
  <p>and when I click on &quot;view in console&quot; I see</p>
  <blockquote>
  <pre><code>POST http://machine_ip&gt;:&lt;machine_port&gt;/path/objectA/
  Error: Parse Error: Expected HTTP/
  Request Headers
  Content-Type: application/json
  User-Agent: PostmanRuntime/7.28.4
  Accept: */*
  Postman-Token: d644d7dd-699b-4d77-b32f-46a575ae31fc
  Host: xx.xxx.x.xx:22
  Accept-Encoding: gzip, deflate, br
  Connection: keep-alive
  Request Body
  </code></pre>
  </blockquote>
  <p>What does <code>Error: Parse Error: Expected HTTP/</code> mean?</p>
  <p>I checked my app logs but it seems it is not handling any request, even if Postman indicates that the server is returning a (malformed) response.</p>
  <p>I also tryed to chenge the target url to:</p>
  <pre><code>https...
  </code></pre>
  <p>but it returns</p>
  <blockquote>
  <pre><code> Error: write EPROTO 28427890592840:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242:
  </code></pre>
  </blockquote>
  <p>which I found out <a href="https://stackoverflow.com/questions/62658941/error-write-eproto-34557064error100000f7ssl-routinesopenssl-internalwrong">it indicates I should stick with HTTP</a></p>
  <p>Then I tried also:</p>
  <pre><code>http://&lt;machine_ip&gt;/path/objectA/
  </code></pre>
  <p>and</p>
  <pre><code>&lt;machine_ip&gt;/path/objectA/
  </code></pre>
  <p>which generically return:</p>
  <blockquote>
  <pre><code>Error: connect ECONNREFUSED &lt;machine_ip&gt;:80
  </code></pre>
  </blockquote>
  <p>I also tryed to substitute line</p>
  <pre><code>urls += [(r'/path/objectA/(.*)', ObjectAHandler)]  
  </code></pre>
  <p>with</p>
  <pre><code>urls += [(r'/path/objectA/', ObjectAHandler)]  
  </code></pre>
  <p>and</p>
  <pre><code>urls += [(r'/path/objectA', ObjectAHandler)]  
  </code></pre>
  <p>but none of these worked.</p>
  <p>What is wrong? How can I fix it?</p>
  <h2>UPDATE</h2>
  <p>Apparently, according to <a href="https://github.com/postmanlabs/postman-app-support/issues/9176#issue-724568528" rel="nofollow noreferrer">this thread</a> on Postman Github, the problem happens only on Postman Desktop and not on Postman on browser.</p>
  <p>So I tryed to send the request form Postman on my browser but I get</p>
  <blockquote>
  <pre><code> Cloud Agent Error: Can not send requests to reserved address. Make sure address is publicly accessible or select a different agent.
  </code></pre>
  </blockquote>
  <p>because, according to <a href="https://stackoverflow.com/a/67156814/7658051">this other thread</a>,</p>
  <blockquote>
  <p>Postman Website cannot send a request to your computer's localhost. It first needs to connect to your PC with the Postman desktop client</p>
  </blockquote>
  <p>and even if I follow the indications in that answer</p>
  <blockquote>
  <p>Run it [ndr. Postman desktop], then go to the Postman workspace in your browser -&gt; send the request and it will work.</p>
  </blockquote>
  <p>I still get the same</p>
  <blockquote>
  <pre><code>Error: Parse Error: Expected HTTP/
  </code></pre>
  </blockquote>
  <p>on both Postman Desktop and Postman on browser.</p>
  <h2>UPDATE</h2>
  <p>Going on debugging, I tryed to cast a curl on that URL from my terminal:</p>
  <pre><code>myuser@mymachine-VirtualBox:~$ curl --verbose &quot;http://&lt;target_machine_ip&gt;:&lt;target_machine_port&gt;/path/objectA&quot;
  </code></pre>
  <p>and I got:</p>
  <blockquote>
  <pre><code>*   Trying &lt;target_machine_ip&gt;:&lt;target_machine_port&gt;...
  * Connected to &lt;target_machine_ip&gt; (&lt;target_machine_ip&gt;) port &lt;target_machine_port&gt; (#0)
  &gt; GET /orkpos5/receipt HTTP/1.1
  &gt; Host: &lt;target_machine_ip&gt;:&lt;target_machine_port&gt;    
  &gt; User-Agent: curl/7.74.0    
  &gt; Accept: */*    
  &gt;     
  * Received HTTP/0.9 when not allowed  
      
  * Closing connection 0    
  curl: (1) Received HTTP/0.9 when not allowed
  </code></pre>
  </blockquote>