From the course: JavaScript: Ajax and Fetch
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Work with malformed requests - JavaScript Tutorial
From the course: JavaScript: Ajax and Fetch
Work with malformed requests
- [Narrator] As you're first building out your request code, it's not uncommon to receive errors due to malformed requests. This type of error results from an error in either the data you're sending, or the syntax of your request. A few common issues are often at the root of malformed requests. One of these is simply an invalid endpoint. That can include forgetting HTTP or HTTPS at the start of the URL, or not providing the full path for the endpoint, or even using an outdated endpoint for which support has ended. Another place to look is in the separator characters in the query section of the URL. Forgetting the question mark at the start of the query string, or omitting the ampersand between key value pairs, or the equal sign separating a key from a value can all result in un-parsable data, or in data that's parsed by the endpoint in a different way than you intended. Finally it's important to check that the keys and values you're sending in the query string map to what's expected…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Structure Ajax requests for performance2m 49s
-
(Locked)
View requests and responses in the browser3m 21s
-
(Locked)
Work with authorization errors2m 56s
-
(Locked)
Work with malformed requests5m 15s
-
(Locked)
Work with errors in Fetch4m 44s
-
(Locked)
Provide error fallbacks7m 15s
-
(Locked)
Challenge: Fix an Ajax request49s
-
(Locked)
Solution: Fix an Ajax request4m 29s
-
(Locked)
-
-