
Preguntas sobre manejo de API
Authored by José Castro
Engineering
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
¿Qué método de fetch te permite manejar errores HTTP correctamente?
Todas las anteriores
{ method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json' } }
Ambas A y B
response.ok
response.json()
Answer explanation
La opción correcta es 'response.json()' porque permite manejar la respuesta JSON de manera adecuada, incluyendo la gestión de errores HTTP. 'response.ok' solo verifica el estado, pero no maneja el contenido.
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
¿Cuál es una ventaja principal de Axios frente a fetch?
Ambas A y B
Todas las anteriores
response.json()
response.ok
Parseo automático de JSON
Answer explanation
Una ventaja principal de Axios es el parseo automático de JSON. A diferencia de fetch, que requiere llamar a response.json() para convertir la respuesta, Axios lo hace automáticamente, simplificando el manejo de datos JSON.
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
¿Qué propiedad del objeto Response debes usar para convertir los datos a JSON?
response.json()
response.ok
Parseo automático de JSON
Ambas A y B
Todas las anteriores
Answer explanation
La propiedad correcta para convertir los datos a JSON es response.json(). Esta función permite extraer el cuerpo de la respuesta y convertirlo en un objeto JavaScript. Las otras opciones no son correctas para esta tarea.
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
¿Qué falta en este fragmento para evitar un error cuando el servidor falla?
Agregar catch()
Ambas A y B
Todas las anteriores
validar res.ok
{ method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json' } }
Answer explanation
Para manejar errores cuando el servidor falla, es necesario agregar un bloque 'catch()' para capturar excepciones y validar 'res.ok' para verificar si la respuesta fue exitosa. Por lo tanto, la respuesta correcta es 'Ambas A y B'.
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
¿Cómo se vería una solicitud POST en fetch con datos en el body?
response.ok
response.json()
Ambas A y B
Parseo automático de JSON
{ method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json' } }
Answer explanation
La opción correcta es la que muestra cómo se configura una solicitud POST en fetch. Incluye el método 'POST', el cuerpo con los datos convertidos a JSON y los encabezados necesarios para indicar el tipo de contenido.
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
¿Qué opción es válida para capturar errores usando async/await con Axios?
Estado “cargando...”
Todas las anteriores
error.response
error.message
error.status
Answer explanation
La opción correcta es 'Todas las anteriores' porque al capturar errores con async/await y Axios, se pueden utilizar 'error.response', 'error.message' y 'error.status' para manejar diferentes aspectos del error.
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
En la mini-app del Pokémon, ¿cuál es un estado esencial que debes manejar?
Estado “cargando...”
Mejora la modularidad y la reutilización
Usar variables de entorno y/o proxy seguro
Cuando las peticiones son independientes y pueden ejecutarse en paralelo
Answer explanation
El estado 'cargando...' es esencial en la mini-app del Pokémon porque indica al usuario que la aplicación está procesando información, mejorando la experiencia de usuario al gestionar la espera de manera efectiva.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
12 questions
TEMA 1
Quiz
•
University
13 questions
SAM-UN I -FUNDAMENTOS Y EVOLUCIÒN DE LA GESTIÒN DE MANTENIMIENTO
Quiz
•
University
10 questions
PARCIAL INGENIERIA BIOMEDICA
Quiz
•
University
12 questions
Prueba de Conocimiento C: DIMENSIÓN 3 - COMUNIDAD UNIVERSITARIA
Quiz
•
University
9 questions
Arquitectura Interna de un PLC
Quiz
•
University
10 questions
SILICATOS
Quiz
•
University
14 questions
Inducción de Seguridad - Ecoclean - Ecogas
Quiz
•
12th Grade - University
10 questions
LA MÁQUINA ELÉCTRICA
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Engineering
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
7 questions
Fragments, Run-ons, and Complete Sentences
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
10 questions
DNA Structure and Replication: Crash Course Biology
Interactive video
•
11th Grade - University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
5 questions
Examining Theme
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University