VlaDDoS111
New member
#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid = "ssid";
const char* password = "password";
unsigned long lastTime = 0;
unsigned long timerDelay = 5000;
void setup() {
Serial.begin(115200);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
// Define host and port
}
void loop() {
if ((millis() - lastTime) > timerDelay) {
if(WiFi.status()== WL_CONNECTED){
const char* host = "k912019u.beget.tech";
int port = 80;
// Define path
const char* path = "/com/btnr.php?btnReaction=wc";
// Send HTTP GET request
HTTPClient http;
http.addHeader("User-Agent", "Mozilla/5.0");
http.begin(host, port, path); // Use begin with host and port
int httpResponseCode = http.GET();
// Check for response
if (httpResponseCode > 0) {
String response = http.getString();
Serial.println("HTTP Response: " + response);
} else {
Serial.print("Error on HTTP request. Error code: ");
Serial.println(httpResponseCode);
}
http.end();
}
else {
Serial.println("WiFi Disconnected");
}
lastTime = millis();
}
}
Вот так возвращает 403
#include <HTTPClient.h>
const char* ssid = "ssid";
const char* password = "password";
unsigned long lastTime = 0;
unsigned long timerDelay = 5000;
void setup() {
Serial.begin(115200);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
// Define host and port
}
void loop() {
if ((millis() - lastTime) > timerDelay) {
if(WiFi.status()== WL_CONNECTED){
const char* host = "k912019u.beget.tech";
int port = 80;
// Define path
const char* path = "/com/btnr.php?btnReaction=wc";
// Send HTTP GET request
HTTPClient http;
http.addHeader("User-Agent", "Mozilla/5.0");
http.begin(host, port, path); // Use begin with host and port
int httpResponseCode = http.GET();
// Check for response
if (httpResponseCode > 0) {
String response = http.getString();
Serial.println("HTTP Response: " + response);
} else {
Serial.print("Error on HTTP request. Error code: ");
Serial.println(httpResponseCode);
}
http.end();
}
else {
Serial.println("WiFi Disconnected");
}
lastTime = millis();
}
}
Вот так возвращает 403