Questions tagged [react-fetch-api]

6 questions
1
vote
1 answer

When API returns 400 status code, Getting error message using Reactjs fetch

I'm using Reactjs web application. There I'm calling Nodejs RestAPI. When API returns status code 400, I can't get it error message which is coming from API. I'm not able to get the errorDesc from API response. 400 error API response { …
Maria Jeysingh Anbu
  • 3,164
  • 3
  • 34
  • 55
0
votes
1 answer

Fetch API, giving me index.html and not giving me the dom structure of my UI in react JS

I have built an app on reactjs and hosted internally, when I perform a fetch api or xhr, I'm getting only the index.html in the public folder, and it ends at id=root. However it's not giving me the html available in app.js of the source file which…
0
votes
2 answers

React: CORS Error when fetching Youtube page

I need to get the HTML markup of a YouTube video page. Here is the code: async function get_subtitles(video_id: string): Promise { if (video_id.includes('https://') || video_id.includes('http://')) throw new EvalError("You provided…
wineT
  • 15
  • 4
0
votes
0 answers

In MERN app, API Request to node thorught react only getting the response back If refresh the node server after making the API request from react

Have MERN appication Everything was working fine when I was testing in POSTMAN. If you select a video file with POSTMAN. you will get correct error in response "That only Image should uploaded" which is what expected But tried same thing using…
0
votes
1 answer

How to store a cookie sent from Express server by using fetch API in React?

I'm trying to create signup Form using React, Express and MongoDB. I succeffuly implemented the post request and saved the user data in the database. However,though the user is saved in the database, I failed to store ( see it the browser ) the jwt…
-4
votes
1 answer

Hey Guys i have a problem in my react class base component by using the setstate please anyone solve this error

This is my and i am trying to fetch api and show the result in my next react component but if i can set the state in the componetmountfunction it can cause the error. !this.state.articles.map is not a function!. Please solve this problem and also…
Rick Kim
  • 1
  • 2