Send sensor data to internet using ESP8266 and Arduino

Hi, I am new to this forum and I am posting this question here as I find it relevant to my topic. I have a project there I have to sent multiple sensor data to internet. I am thinking of programming esp8266 and Arduino seperately and trigger method in 8266 from arduino. The esp8266 will only make get and post request with sensor data while Arduino will trigger the method in esp8266 with sensor data as argument. Please tell whether this is feasible and it will be really helpful if you can provide link for post or tutorial for two way communication between Arduino and esp8266 to trigger method over serial

Can you explain why you want to do things this way? What is the Arduino doing that the esp8266 cannot do for itself?

There can be valid reasons for wanting to do things this way. For example in my weather station, I use an ATtiny85 to monitor the anemometer, wind vane and rain sensors and the esp is in deep sleep. Every 15 mins, the esp wakes and requests the readings from the tiny over serial. This arrangement save battery power, because the tiny consumes far less power than the esp would it it were not in deep sleep. The sensors need constant monitoring.

Other sensors do not need constant monitoring, such as temp, humidity, barometric pressure, so an esp can read the sensors every few minutes when awake, and spend the rest of the time in deep sleep.

As Paul says above.
I have also made a weather station with multiple sensors (DHT22,DS18B20 and an ATtiny85 couting spins of an anemometer).
The sensors are directly connected to the need for an arduino.
They send the data in a basic POST request to my website running with a mySQL database.

Here is a snippet of my code:

// We now create a URI for the request

  Serial.print("Requesting URL: ");

  // This will send the request to the server
  String data = "temperature=" + String(tempbuff) + "&sensorid=" + String(sensor)+"&windcount="+String(windcount) + "&humidity=" + String(buff2) + "&voltage=" + String(Vs);
  Serial.print("Data string to send is: ");
  Serial.print(data + "\t");
  Serial.print(" which is bytes: \t");

  Serial.print("connecting to ");

  // Use WiFiClient class to create TCP connections
  WiFiClient client;
digitalWrite(led, 0);
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");


  // if you get a connection, report back via serial
  if (client.connect(host, httpPort)) {
    Serial.println("Connected to server");
  client.println("POST " + url + " HTTP/1.1");
  client.println("Host:" + String(host));
  client.println("Content-Type: application/x-www-form-urlencoded");
  client.print("Content-Length: ");
digitalWrite(led, 0);
  unsigned long timeout = millis();
  while (client.available() == 0) {
    if (millis() - timeout > 5000) {
      Serial.println(" >>> Client Timeout !");

  // Read all the lines of the reply from server and print them to Serial
  while (client.available()) {
    String line = client.readStringUntil('\r');

My indoor sensors.

My weather station.