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

Work with malformed requests - JavaScript Tutorial

From the course: JavaScript: Ajax and Fetch

Start my 1-month free trial

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…

Contents