Football Prediction

FREEMIUM
Durch boggio | Aktualisiert 17日前 | Sports
Popularität

9.9 / 10

Latenz

1,633ms

Service Level

100%

Health Check

N/A

Zurück zu allen Diskussionen

key in react.js

Rapid account: Carlos Giil 97
CarlosGiil97
3年前
Currently I am doing it like this:

const url = “https://football-prediction-api.p.rapidapi.com/api/v2/performance-stats”;

But I get an error that I am missing the api-key, how could I use it?

Thank you

Rapid account: Boggio Analytics
boggio-analytics Commented 3年前

You need to provide an opts parameter when you do the fetch, something like this

    const opts = {
        headers: {
            Accept: "application/json",
            "Content-Type": "application/json",
            "X-RapidApi-Key": "YOUR_KEY",
            "User-Agent": "APP_NAME + VERSION"
        },
        cache: "no-cache",
    };

    fetch(url, opts)

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen