Bayut

FREEMIUM
Verified
By Api Dojo | Updated hace 5 días | Business
Popularity

9.7 / 10

Latency

1,633ms

Service Level

100%

Health Check

N/A

Back to All Discussions

issue of undefined

Rapid account: Abelrobel 7
abelrobel7
hace un año

import axios from “axios”;

export const baseUrl = “https://bayut.p.rapidapi.com”;

export const fetchApi = async (url) => {
const { data } = await axios.request(url, {
method: “GET”,
headers: {
“RapidAPI-Key”:process.env.API_KEY,
“RapidAPI-Host”: “bayut.p.rapidapi.com”,
},
});

return data;
};

i am getting undefined after trying to fetch data with that??

Rapid account: Apidojo
apidojo Commented hace un año

Hello,

What was the data const sent to the endpoint? You need to send enough information so I can reproduce your issue. In addition, you may manually test it again by using an HTTP client such as postman.com to validate the case.

Regards.

Join in the discussion - add comment below:

Login / Signup to post new comments