Thursday, May 16, 2019

JavaScript(17)---Introduction to Requests

Introduction to Requests

One of JavaScript’s greatest assets is its non-blocking properties, or that it is an asynchronous language.
ADVANCED VERSION OF IT
REVIEW:

  • 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.
  • There are many HTTP request methods, two of which are GET and POST.
  • GET requests only request information from other sources.
  • POST methods can introduce new information to other sources in addition to requesting it.
  • GET requests can be written using an XMLHttpRequest object and vanilla JavaScript.
  • POST requests can also be written using an XMLHttpRequest object and vanilla JavaScript.
  • 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.
  • To add a query string to a URL endpoint you can use ? and include a parameter.
  • To provide additional parameters, use & and then include a key-value pair, joined by =.
  • 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.
What did I learn in this lesson? 
I did not learn too much on the coding part, however, I learned about a new way of using the codes. And this is actually pretty cool, and can be used in doing surveys.
What I'll be doing tomorrow?

Introduction to Requests with ES6

No comments:

Post a Comment