I have try all function below in HTTPClient.h but none is working
/// Response handling
void collectHeaders(const char* headerKeys[], const size_t headerKeysCount);
String header(const char* name); // get request header value by name
String header(size_t i); // get request header value by number
String headerName(size_t i); // get request header name by number
int headers(); // get header count
bool hasHeader(const char* name); // check if header exists
The getString() call might read from the stream and empty the incoming buffer, skipping the headers that are then no longer available to scan (possibly)..
what happens if you do
void httpHeader()
{
if (WiFi.isConnected())
{
HTTPClient http;
http.begin("http://192.168.1.34:80/mesh_info");
http.addHeader("Content-Type", "application/json");
int httpResponseCode = http.GET();
Serial.println(http.header("Mesh-Node-Mac"));
Serial.println(http.getString());
http.end();
}
}
Try printing out httpResponseCode after the GET. If it isn't 200 then something went wrong with the request and you can't expect the response header to contain your data.