View on GitHub

reading-notes

Reading Notes about Markdown-Html-Css-JavaScript

explained REST

GET requests The .query() method accepts objects, which when used with the GET method will form a query-string. The following will produce the path /search?query=Manny&range=1..5&order=desc.

HEAD requests can also use the .query() method for HEAD requests. The following will produce the path /users?email=joe@smith.com.

Response status The response status flags help determine if the request was a success, among other useful information, making SuperAgent ideal for interacting with RESTful web services.

CORS For security reasons, browsers will block cross-origin requests unless the server opts-in using CORS headers. Browsers will also make extra OPTIONS requests to check what HTTP headers and methods are allowed by the serve

Promise and Generator support SuperAgent’s request is a “tunable” object that’s compatible with JavaScript promises and the async/await syntax. If you’re using promises, do not call .end() or .pipe(). Any use of .then() or await disables all other ways of using the request. _______________

API Key