Skip to content
Advertisement

Tag: api

Pulling and displaying API data to tailwind cards

could someone help on how to get all data from this console log? I am trying to display all the details in individual tailwind cards but not sure how to get the data. Thank you for your time. It works and I get the results below in console. when I tried console.log (response.data.0.pdf) for example, it gives an error “Parsing

How do I get data from Firebase collection using NextJs API, Firebase Firestore, axios and TypeScript?

I’m using api routes in NextJS 13, to fetch data from Firebase like this(api/locations.tsx): Then I have a component Locations.tsx where I’m trying to store the locations in locations state object like this: But I’m getting an error Property ‘locationsData’ does not exist on type ‘GetLocationResponse’. even though I tried adding “locationsData” to my type definition type GetLocationResponse = {

res.redirect() not working properly in express JS

I’ve been working on creating an API for a blockchain I’ve made. Everything was going fine, until I updated Node and Windows… ====== ISSUE ====== After performing a POST request, I cannot redirect to a GET page anymore. (Using Postman only no front end yet). For some reason, it was working fine and now I can’t do it in a

Replace fetch link with html button

This code is designed to take a data from API, convert it to JSON and display it in the HTML page (with a specific design). There are two buttons on the HTML page that are for changing the page (to change the page, the URL sent to fetch needs to be changed by clicking the buttons (which is where my

Read response from HttpRequest in JavaScript

First, you can ignore that this is sending credentials in an unsafe manner. I’m supposed to handle that after. My problem is with reading the ‘response’ or ‘responseText’ from a HttpRequest to an API. I can see in the console the request is succesful and the response I want is there, but I am not able to retrieve it. I

Why I can get and api data with fetch and not with axios?

I got this test code: I’m trying to understand why readWithFetch works fine and axios gets connection refused. It’s a simple basic auth… nothing fancy. I’ve tried all these readWithAxios versions: version 1 version 2 version 3 version 4 What is the correct way to write readWithAxios ? Answer You have a triple slash in https:///geolite in the Axios versions.

Shuffling in react

I am fetching data from an api.Trying to make quiz application from the data of an API.I have selected random countries and their respective capitals and map them to my quiz application.I have achieved this already.Now i am trying to shuffle my answer options but not able to do that.anybody can please help? Here is my code I have applied

Trying to sort an API set by date range

Good day everyone, I’ve fetched this set of data from new york city’s open data API portal and am trying to sort all entries by endpoint inspection_date within the past two years. I’d also like to sort the results by the latest times first. However, I’m having trouble getting my endpoints to cooperate. I’ve read the API documentation several times

Advertisement