Reading InputStream of NANOHTTPD gives Socket TimeOut Exception Getting the content length from the header and reading up to it solved the problem.