function is working incorrectly

hi friends

i get data x.com/id.php, data on this page 12

but http2.GET(); gives fixed data = 200

what is problem ?

but http2.GET(); gives fixed data = 200

what is problem ?

The problem is that you don't understand what the function is doing (because it is poorly named, most likely). The function made the GET request, and the result of that was a status of 200, which means that it worked.

There is another function that you need to call to get the actual result of the GET request.

I can't find a picture of the function, though. You'll need to actually look at the examples that came with the library that you showed a picture of using.

PaulS:
The problem is that you don't understand what the function is doing (because it is poorly named, most likely). The function made the GET request, and the result of that was a status of 200, which means that it worked.

There is another function that you need to call to get the actual result of the GET request.

I can't find a picture of the function, though. You'll need to actually look at the examples that came with the library that you showed a picture of using.

i checked but i can't find..can you help please ?

i checked but i can't find.

You can't find what?

Post your code AS TEXT. ALL of it. In code tags.

Then, we can see what libraries you are using, and look up the proper function to call, for you.

PaulS:
You can't find what?

Post your code AS TEXT. ALL of it. In code tags.

Then, we can see what libraries you are using, and look up the proper function to call, for you.

upload is githup ?

If you can post text AS TEXT, fix your problem yourself.

main

#include <Arduino.h>

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

const char* ssid = "Kablonet_Netmaster-FAF6-G";
const char* password = "mortMen20122111";

void setup() {

  Serial.begin(115200); // Start the serial monitor.
  pinMode(2, OUTPUT); // Set GPIO2 as an OUTPUT.
  digitalWrite(2, 0); // Start off.
  
  Serial.println("Hello Digital Craft");
  Serial.println("connecting");

  WiFi.begin(ssid,password);
 

  // Show ... until connected:
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("WiFi connected");

  // Print the IP address of the device:
  Serial.println(WiFi.localIP());
  
}

void loop() {
  // put your main code here, to run repeatedly:
// Verfiy WiFi is connected:
  if (WiFi.status() == WL_CONNECTED) {

    HTTPClient http;  // Object of the class HTTPClient.
    HTTPClient http2;

    http2.begin("http://hendislik.com/id.php");
    //int httpCode2=http2.GET();  
    int httpCode2=http2.POST();
    Serial.println(httpCode2);
    if (httpCode2==200)
    {
      http.begin("http://hendislik.com/goster.php");  // Request destination.
      int httpCode = http.GET(); // Send the request.

      if (httpCode > 0) { //Check the returning code

      
      String payload = http.getString();   // Get the text from the destination (1 or 0).
      Serial.println(payload); // Print the text.
      digitalWrite(2, payload.toInt()); // Send the payload value to the pin.

      }else{

      Serial.println("Something baaaaaaad happened!");

      }

      http.end();   //Close connection
    }
    
      else
      {
        Serial.println("Something baaaaaaad h22222!");
      }
      
      http2.end();
    

  }

  delay(1000);    //Send a request every 30 seconds
}

ESP8266HTTPClient.h

ESP8266HTTPClient.h

If you paid any attention to those links, you'd see that there ARE examples.

PaulS:
If you paid any attention to those links, you'd see that there ARE examples.

i am trying but not yet..Can you help please ?

atiker:
i am trying but not yet..Can you help please ?

Can't you see that the first link on that page is labeled examples? What do you suppose that they are trying to hide in that folder?

Those examples are on your computer, too.

Notice, too, how I was able to use the link icon, and make that URL a hyper-link. That is a skill you should acquire, too.