Skip to Content
Learn
Requests I
Review Requests I

You’ve done an amazing job navigating through making XHR GET and POST requests! Take some time to review the core concepts before moving on to the next lesson.

  1. JavaScript is the language of the web because of its asynchronous capabilities. AJAX, which stands for Asynchronous JavaScript and XML, is a set of tools that are used together to take advantage of JavaScript’s asynchronous capabilities.

  2. There are many HTTP request methods, two of which are GET and POST.

  3. GET requests only request information from other sources.

  4. POST methods can introduce new information to other sources in addition to requesting it.

  5. GET requests can be written using an XMLHttpRequest object and vanilla JavaScript.

  6. POST requests can also be written using an XMLHttpRequest object and vanilla JavaScript.

  7. Writing GET and POST requests with XHR objects and vanilla JavaScript requires constructing the XHR object using new, setting the responseType, creating a function that will handle the response object, and opening and sending the request.

  8. To add a query string to a URL endpoint you can use ? and include a parameter.

  9. To provide additional parameters, use & and then include a key-value pair, joined by =.

  10. Determining how to correctly write the requests and how to properly implement them requires carefully reading the documentation of the API with which you’re working.

Instructions

Play around with the browser and code to make GET and POST requests. If you’re going to make POST requests, make sure you assign apiKey your Rebrandly API key and run the code!

If you want to challenge yourself:

  • Build shortenUrl() or getSuggestions() from scratch.
  • Manipulate the object that is returned to display something different in the browser.
  • Use a different API to make a GET or POST request.
  • Create query strings to yield different results.
Folder Icon

Take this course for free

Already have an account?