user28154: I'm using an ESP8266 version 1 with the WiFiEsp library to connect to WiFi, and that works just fine.
I'm setting up the device using the same code as in the example WebClientRepeating.
I need to send a POST request instead of a GET request, but I can't get it to work as I want. If I create my POST request like this, it works just fine:
if (client.connect(server, 3005)) {
  Serial.println("Connecting...");

  // send the HTTP POST request  
  client.println("POST /open/peripherals HTTP/1.1");
  client.println("Host: 192.168.10.137:3005");
  client.println("User-Agent: Arduino/1.0");
  client.println("Connection: close");
  client.println();

  // note the time that the connection was made
  lastConnectionTime = millis();
}
else {
  // if you couldn't make a connection
  Serial.println("Connection failed");
}

I get the response like this:
[WiFiEsp] Connecting to 192.168.10.137
Connecting...
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 19
ETag: W/"13-jSAaqMh5E3R94/b2aONzvg"
Date: Sun, 13 Nov 2016 10:20:58 GMT
Connection: close

{"temp":"Testdata"}

However, if I try to send some body data in the request it fails:
if (client.connect(server, 3005)) {
  Serial.println("Connecting...");

  // send the HTTP POST request  
  client.println("POST /open/peripherals HTTP/1.1");
  client.println("Host: 192.168.10.137:3005");
  client.println("User-Agent: Arduino/1.0");
  client.println("Connection: close");
  client.println("Content-Type: application/x-www-form-urlencoded");
  client.println("Content-Length: 16");
  client.println();
  client.println("temperature=22.7");

  // note the time that the connection was made
  lastConnectionTime = millis();
}
else {
  // if you couldn't make a connection
  Serial.println("Connection failed");
}

Then the response from serial output is:
[WiFiEsp] Connecting to 192.168.10.137
Connecting...
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] Data packet send error (1)
[WiFiEsp] Failed to write to socket 0
[WiFiEsp] Disconnecting  0

However, the POST request including the body is received by the Web server just fine, but the response sent to the Arduino I can't read because it shows me an error instead of a proper response. From my webserver the response for the POST call that works and the POST call that fails is the same.
Does anyone knows why this fails when I add Content-Type, Content-Length and some body data?
Thanks in advance!

user30663: Your problem is the content you are sending. While this format works well e. g. in Python libraries, this library seems to have a problem with it. 
I solved it this way, when I happened to face this problem: 
//all your other code, including the remaining HTTP-Request
String content = "{\"temperature\":\""+String(value)+"\"}";
client.println("Content-Length: 16"); //insert, well, your content length
client.println(content);


28154: <p>I'm using an ESP8266 version 1 with the <a href="https://github.com/bportaluri/WiFiEsp" rel="nofollow noreferrer">WiFiEsp library</a> to connect to WiFi, and that works just fine.</p>

<p>I'm setting up the device using the same code as in the example <a href="https://github.com/bportaluri/WiFiEsp/blob/master/examples/WebClientRepeating/WebClientRepeating.ino" rel="nofollow noreferrer"><code>WebClientRepeating</code></a>.</p>

<p>I need to send a POST request instead of a GET request, but I can't get it to work as I want. If I create my POST request like this, it works just fine:</p>

<pre><code>if (client.connect(server, 3005)) {
  Serial.println("Connecting...");

  // send the HTTP POST request  
  client.println("POST /open/peripherals HTTP/1.1");
  client.println("Host: 192.168.10.137:3005");
  client.println("User-Agent: Arduino/1.0");
  client.println("Connection: close");
  client.println();

  // note the time that the connection was made
  lastConnectionTime = millis();
}
else {
  // if you couldn't make a connection
  Serial.println("Connection failed");
}
</code></pre>

<p>I get the response like this:</p>

<pre><code>[WiFiEsp] Connecting to 192.168.10.137
Connecting...
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 19
ETag: W/"13-jSAaqMh5E3R94/b2aONzvg"
Date: Sun, 13 Nov 2016 10:20:58 GMT
Connection: close

{"temp":"Testdata"}
</code></pre>

<p>However, if I try to send some body data in the request it fails:</p>

<pre><code>if (client.connect(server, 3005)) {
  Serial.println("Connecting...");

  // send the HTTP POST request  
  client.println("POST /open/peripherals HTTP/1.1");
  client.println("Host: 192.168.10.137:3005");
  client.println("User-Agent: Arduino/1.0");
  client.println("Connection: close");
  client.println("Content-Type: application/x-www-form-urlencoded");
  client.println("Content-Length: 16");
  client.println();
  client.println("temperature=22.7");

  // note the time that the connection was made
  lastConnectionTime = millis();
}
else {
  // if you couldn't make a connection
  Serial.println("Connection failed");
}
</code></pre>

<p>Then the response from serial output is:</p>

<pre><code>[WiFiEsp] Connecting to 192.168.10.137
Connecting...
[WiFiEsp] &gt;&gt;&gt; TIMEOUT &gt;&gt;&gt;
[WiFiEsp] Data packet send error (1)
[WiFiEsp] Failed to write to socket 0
[WiFiEsp] Disconnecting  0
</code></pre>

<p>However, the POST request including the body is received by the Web server just fine, but the response sent to the Arduino I can't read because it shows me an error instead of a proper response. From my webserver the response for the POST call that works and the POST call that fails is the same.</p>

<p>Does anyone knows why this fails when I add <code>Content-Type</code>, <code>Content-Length</code> and some body data?</p>

<p>Thanks in advance!</p>
 30663: <p>Your problem is the content you are sending. While this format works well e. g. in Python libraries, this library seems to have a problem with it. 
I solved it this way, when I happened to face this problem: </p>

<pre><code>//all your other code, including the remaining HTTP-Request
String content = "{\"temperature\":\""+String(value)+"\"}";
client.println("Content-Length: 16"); //insert, well, your content length
client.println(content);
</code></pre>
