NodeMCU server bad response, when sending GET request from Android app
<p>I've made little server based on NodeMCU. All works good, when I'm conneting from browser, but problem starts, when I'm trying to connect from Android app uisng OkHttp or Volley, I'm receiving exceptions.
java.io.IOException: unexpected end of stream on Connection using OkHttp,
EOFException using Volley.</p>

<p>Problem is very similar for this
<a href="https://stackoverflow.com/questions/33396681/eofexception-after-server-responds">EOFException after server responds</a>, but answer didn't found.</p>

<p><strong>ESP server code</strong></p>

<pre><code>srv:listen(80, function(conn)

  conn:on("receive", function(conn,payload)
    print(payload)
    conn:send("&lt;h1&gt; Hello, NodeMCU.&lt;/h1&gt;")
  end)
  conn:on("sent", function(conn) conn:close() end)
end)
</code></pre>

<p><strong>Android code</strong></p>

<pre><code>final RequestQueue queue = Volley.newRequestQueue(this);
final String url = "http://10.42.0.17:80";
</code></pre>

<hr>

<pre><code>final StringRequest request = new StringRequest(Request.Method.GET, url,
            new Response.Listener&lt;String&gt;() {

                @Override
                public void onResponse(String response) {
                    mTemperatureTextView.setText(response.substring(0, 20));
                    System.out.println(response);
                }
            },

            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    System.out.println("Error + " + error.toString());
                    mTemperatureTextView.setText("That didn't work!");
                }
            }
    );
</code></pre>

<hr>

<pre><code>mUpdateButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            queue.add(request);
        }
    });
</code></pre>