Giter VIP home page Giter VIP logo

esp8266webhook's Issues

404 errors from esp8266

From my computer command line, no issues, trigger gets fired.

curl -X POST -H "Content-Type: application/json" -d '{"this":[{"is":{"some":["test","data"]}}]}' https://maker.ifttt.com/trigger/\{event\}/json/with/key/xxxxxxxxxxxxxxxxxxxxx
Congratulations! You've fired the event JSON event%

works for this as well

https://maker.ifttt.com/trigger/Issue/json/with/key/xxxxxxxxxxxxxxxxxxxxx

ESP8266 with this library and error

HTTP Error code: 400

<TITLE>ERROR: The request could not be satisfied</TITLE>

400 ERROR

The request could not be satisfied.


Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.

Generated by cloudfront (CloudFront)
Request ID: dWIumxrnJs-lUEpmP1kNO0gAMyClOoYt_mLwKPb-gyM5gpsDmGZGdA==

void sendWebhook() {
if (WiFi.status() == WL_CONNECTED) {
WiFiClient client;
HTTPClient http;
// Ensure URL is correct
String url = "https://maker.ifttt.com/trigger/Issue/json/with/key/xxxxxxxxxxxxxxxxxxxxx";

    http.begin(client, url); // Start the connection
    http.addHeader("Content-Type", "application/json"); // Set content type to JSON

    // JSON data that works with curl
    String jsonData = "{\"this\":[{\"is\":{\"some\":[\"test\",\"data\"]}}]}";
    int httpCode = http.POST(jsonData); // Send the POST request

    if (httpCode == HTTP_CODE_OK) {
        String payload = http.getString();
        Serial.print("HTTP Response code: ");
        Serial.println(httpCode);
        Serial.println(payload);
    } else {
        Serial.print("HTTP Error code: ");
        Serial.println(httpCode);
        Serial.println(http.getString()); // This will print the detailed error message
    }
    http.end(); // Close the connection
} else {
    Serial.println("WiFi not connected");
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.