Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 5 MCQs HTTP Methods and Routing

INT252 — Web App Development With Reactjs 50 questions. Pick an option to check it.

Read the notes

0 of 50 answered 0 right 0 wrong , 50 left

  1. Question 1 of 50

    Which JavaScript API is built-in to browsers and commonly used to make HTTP requests in React applications?

  2. Question 2 of 50

    What type of object does the fetch() function return?

  3. Question 3 of 50

    Which library is a popular alternative to the native Fetch API for making HTTP requests in React, offering features like automatic JSON transformation?

  4. Question 4 of 50

    In a functional React component, which hook is best suited for performing side effects like data fetching?

  5. Question 5 of 50

    When using the Fetch API, which method is necessary to parse the response body as JSON?

  6. Question 6 of 50

    Which HTTP method is used to retrieve data from a server?

  7. Question 7 of 50

    What is the default HTTP method used by fetch() if none is specified?

  8. Question 8 of 50

    When using axios.get(), where is the response data located in the returned object?

  9. Question 9 of 50

    Which HTTP method is primarily used to send data to a server to create a new resource?

  10. Question 10 of 50

    When sending a POST request using fetch, what must be included in the headers to tell the server you are sending JSON data?

  11. Question 11 of 50

    How do you pass data in the body of a fetch POST request?

  12. Question 12 of 50

    Which HTTP method is typically used to update an existing resource completely?

  13. Question 13 of 50

    What is the difference between PUT and PATCH?

  14. Question 14 of 50

    Which HTTP method is used to remove a resource from the server?

  15. Question 15 of 50

    How does Axios handle HTTP error status codes (like 404 or 500) differently than Fetch?

  16. Question 16 of 50

    What is the standard library used for routing in React applications?

  17. Question 17 of 50

    Which component is used to wrap the entire application to enable routing features?

  18. Question 18 of 50

    In React Router v6, which component is used to define a group of routes?

  19. Question 19 of 50

    Which prop is used in the <Route> component to define the URL path?

  20. Question 20 of 50

    In React Router v6, which prop is used to specify the component to render for a specific route?

  21. Question 21 of 50

    How do you define a default route (404 page) that matches when no other route matches?

  22. Question 22 of 50

    Which component is used to create a clickable link that navigates to a new route without reloading the page?

  23. Question 23 of 50

    Which prop is used in the <Link> component to specify the destination?

  24. Question 24 of 50

    Which hook is used for programmatic navigation in React Router v6?

  25. Question 25 of 50

    Using useNavigate, how do you navigate to the previous page?

  26. Question 26 of 50

    How do you define a dynamic parameter in a route path?

  27. Question 27 of 50

    Which hook is used to access the values of dynamic URL parameters?

  28. Question 28 of 50

    What is a Query String?

  29. Question 29 of 50

    Which hook is used to read and modify query parameters in the URL?

  30. Question 30 of 50

    If the URL is /search?q=react, how do you retrieve the value of 'q' using searchParams?

  31. Question 31 of 50

    How can you pass complex state data (objects) to another route during navigation without showing it in the URL?

  32. Question 32 of 50

    Which hook allows you to access the state passed via navigation?

  33. Question 33 of 50

    What is the difference between <Link> and <NavLink>?

  34. Question 34 of 50

    When using useEffect to fetch data, what should be the second argument to ensure the data is fetched only once on component mount?

  35. Question 35 of 50

    Why is it important to handle 'loading' states when fetching data?

  36. Question 36 of 50

    In an Axios request, what does axios.post('/api/user', { name: 'John' }) do?

  37. Question 37 of 50

    What is the purpose of <Outlet> in React Router?

  38. Question 38 of 50

    How do you install Axios in a React project?

  39. Question 39 of 50

    What property in the Link component replaces the current entry in the history stack instead of adding a new one?

  40. Question 40 of 50

    If you need to execute code after a Fetch request is successfully completed, which Promise method do you use?

  41. Question 41 of 50

    Which Axios feature allows you to intercept requests or responses before they are handled by .then() or .catch()?

  42. Question 42 of 50

    When using async/await with fetch, what keyword must be used before the function definition?

  43. Question 43 of 50

    What is a common use case for passing data via Query Parameters?

  44. Question 44 of 50

    How do you access the history object directly in React Router v6?

  45. Question 45 of 50

    In a nested route structure users/profile, if the path users is the parent, where does profile render?

  46. Question 46 of 50

    Which method is used in fetch to catch network errors?

  47. Question 47 of 50

    If you want to send an Authorization token in the header of an Axios request, where do you put it?

  48. Question 48 of 50

    What is the correct syntax to import React Router components?

  49. Question 49 of 50

    When using fetch, if response.ok is false, what does it usually imply?

  50. Question 50 of 50

    Which of the following is an advantage of using async/await over .then() chaining?

That's unit 5

Answer a few questions and your score shows up here.