Содержание
- 2. CAN REACT DO THIS? React itself doesn’t have any allegiance to any particular way of fetching
- 3. HTTP LIBRARIES Axios Superagent Fetch Etc.
- 4. AXIOS Axios is a very popular JavaScript library you can use to perform HTTP requests, that
- 5. INSTALLATION Or
- 6. API You can start an HTTP request from the axios object: This returns a promise. You
- 7. API METHODS For convenience, you will generally use the methods axios.get() axios.post() axios.delete() axios.put() axios.patch() axios.options()
- 8. API PROMISE SYNTAX If you don’t want to use async/await you can use the Promises syntax:
- 9. API GET PARAMETERS With Axios you can perform this by using that URL or you can
- 10. API POST REQUESTS Performing a POST request is just like doing a GET request, but instead
- 11. API ERROR HANDLING Work with errors:
- 13. Скачать презентацию