Apparently you're not completely reading the HTTP Headers before reading the POST body. Thus, the first two characters of your content array are \r and \n respectively and the two last characters of the body do not get read.
Fix this by reading 2 newlines after the last HTTP header line.