# Obtención de datos y API (React / Next.js) > fetch API, axios, async/await, manejo de errores, estados de carga, abort controllers - 20 preguntas de entrevista - Mid-Level - [Preguntas de entrevista: React / Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista.md) ## 1. ¿Qué devuelve el método fetch() cuando se lo llama? **Respuesta** fetch() devuelve una Promise que se resuelve con un objeto Response. A diferencia de axios, fetch no rechaza automáticamente los errores HTTP (como 404 o 500), por lo que es necesario verificar response.ok antes de parsear los datos. Este enfoque brinda más control sobre el manejo de errores, pero requiere una verificación explícita del estado. ## 2. ¿Cómo extraer datos JSON de un objeto Response obtenido con fetch()? **Respuesta** El objeto Response tiene un método json() que devuelve una Promise que se resuelve con los datos parseados. Este método es asíncrono porque lee el cuerpo de la respuesta de forma progresiva. Es importante verificar primero response.ok antes de llamar a json() para asegurarse de que la solicitud fue exitosa. ## 3. ¿Qué propiedad del objeto Response permite verificar si la solicitud HTTP fue exitosa? **Respuesta** La propiedad response.ok devuelve true si el código de estado HTTP está entre 200 y 299, indicando una respuesta exitosa. Esta propiedad es esencial porque fetch() no rechaza automáticamente los errores HTTP, a diferencia de axios. Verificar response.ok antes de procesar los datos es una buena práctica para evitar parsear respuestas de error. ## 17 preguntas más disponibles - ¿Qué palabra clave permite esperar la resolución de una Promise de manera síncrona en una función async? - ¿En qué orden deben llamarse los siguientes métodos durante un fetch(): json(), then(), catch()? Regístrate gratis: https://sharpskill.dev/es/login ## Otros temas de entrevista React / Next.js - [Fundamentos de JavaScript](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/javascript-essentials.md): 25 preguntas, Junior - [Fundamentos de React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-fundamentals.md): 20 preguntas, Junior - [React Hooks](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-hooks.md): 22 preguntas, Junior - [Ciclo de vida de los componentes](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/component-lifecycle.md): 18 preguntas, Junior - [React Router](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-router.md): 20 preguntas, Junior - [Gestión de estado con Context](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/state-management-context.md): 18 preguntas, Junior - [Formularios y Controlled Components](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/forms-controlled-components.md): 20 preguntas, Mid-Level - [React Query (TanStack Query)](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-query-tanstack.md): 20 preguntas, Mid-Level - [Styling & CSS-in-JS](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/styling-css-in-js.md): 18 preguntas, Mid-Level - [Fundamentos de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-fundamentals.md): 25 preguntas, Mid-Level - [TypeScript con React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/typescript-react.md): 20 preguntas, Mid-Level - [Data Fetching en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-data-fetching.md): 24 preguntas, Mid-Level - [Server Actions de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-server-actions.md): 20 preguntas, Mid-Level - [Routing y Navegación en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-routing-navigation.md): 22 preguntas, Mid-Level - [API Routes de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-api-routes.md): 20 preguntas, Mid-Level - [Metadata & SEO en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-metadata-seo.md): 18 preguntas, Mid-Level - [Middleware y Auth en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-middleware-auth.md): 22 preguntas, Mid-Level - [Testing en React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-testing.md): 20 preguntas, Mid-Level - [Zustand State Management](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/zustand-state-management.md): 18 preguntas, Mid-Level - [Optimización de Rendimiento en React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-performance-optimization.md): 22 preguntas, Senior - [Error Boundaries & Error Handling](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-error-boundaries.md): 18 preguntas, Senior - [Advanced React Patterns](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/advanced-react-patterns.md): 20 preguntas, Senior - [Características avanzadas de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-advanced-features.md): 24 preguntas, Senior - [Despliegue y Producción de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-deployment-production.md): 20 preguntas, Senior - [Architecture & Design Patterns](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-architecture-patterns.md): 22 preguntas, Senior - [React Server Components](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-server-components.md): 26 preguntas, Senior - [Internacionalización de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-internationalization.md): 20 preguntas, Senior - [React Security & Buenas Prácticas](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-security-best-practices.md): 22 preguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/fetching-data-api