Unable to retrieve input stream data from httpExchange
<p>I have wrote a code for an http server that suppose to send a respond to the client based on client input.</p>

<p>I have wrote the same code twice, once using simple socket connection and the second one using <code>com.sun.net.httpserver</code>.</p>

<p>The code based on the simple socket works fine and I am able to read the requests coming from the client using:</p>

<pre><code>DataInputStream in = new DataInputStream (threadSocket.getInputStream());
int ln = in.available();
byte [] bytes  = new byte [ln];
in.read(bytes);
String msg = new String(bytes);
</code></pre>

<p>However, when I am trying to use the httpserver I can not get any input from the client.</p>

<p>This is the code for the http server hendler:</p>

<pre><code>static class ntripHandler implements HttpHandler {
    public void handle(HttpExchange t){ 
        try {
            int ln = t.getRequestBody().available();
            byte [] bt  = new byte [ln];
            t.getRequestBody().read(bt);
            String msg = new String(bt);
            System.out.println(msg);
        } 
        catch (IOException ex) {System.out.println(ex);}

        //// some operations sholuld be made here .......

    }
}
</code></pre>

<p>Currently, I am trying to use the input stream from the <code>HttpExchange.getRequestBody()</code> but it is always null. I have also tried the <code>httpExchange.getRequestURI().getQuery()</code> but it is always null as well.</p>

<p>The input from the client looks like this:
<code>GET / HTTP/1.0
User-Agent: NTRIP GnssSurferV1.10
Authorization: Basic</code></p>

<p>What am I doing wrong and how can I fix it? Any help would be appreciated.</p>