DataFetching Flashcards
308A
What does the readyState property of the XMLHttpRequest object indicate?
The state of the request (e.g., unsent, opened, done).
What can be used to intercept and modify requests or responses globally in Axios?
Interceptors
In Axios, how can you globally configure the default settings for requests?
axios.defaults
What is the primary way to handle the response from an Axios request?
Promises
Which of the following is a method in the XMLHttpRequest object for sending an HTTP request?
send()
How can you set custom headers for an Axios request?
By using the headers property in the config object.
Which method allows you to catch an error when using the fetch API?
catch()
What is a common use for the fetch API in modern JavaScript?
Making AJAX requests
Which of the following are methods on the Response object provided by the fetch API? Select all that apply.
text()
json()
If you want to make a POST request using the fetch API, what property would you need to set in the options object?
method
What does AJAX stand for?
Asynchronous JavaScript and XML.
Which of these is not a response method in Axios?
axios.data()
Which status code typically indicates a successful HTTP GET request?
200