Ethernet Client/Server Weirdness...

Does anyone have an idea why I'm not getting all the bytes from the Client response? See where I send out the post, that works and I get back:

HTTP/1.1 200 OK

But I don't get the full 2816 bytes but only about 800 total. Any ideas?

Here is the relevant code:

(Note: out() is a function that prints out to the serial - not included in this excerpt)

void getMetaData()
   Client client(deviceip, 1400); // used for connecting out to device
  if (client.connect()) {
    if (debug) {
    out("POST /TestRequest HTTP/1.1", client); 
    out("Connection: close", client);
    out("Host:", client);
    out("Content-Length: 1");
    out("Content-Type: text/xml; charset=\"utf-8\"", client);

    while (client.available()) {
      char inChar =;

  } else {
    if (debug) {
      Serial.println("connection failed");

Does what you do get back match what was sent by the server? The content length value may not accurately match the number of bytes sent, depending on encoding and other factors.

Found the issue! Needed to respond back with a 200... otherwise, the device terminated the connection.