Building a custom HTTP library in three versions using different syntax.
Version | File names | Using |
---|---|---|
ver 1 | app_ver1.js, easyhttp_ver1.js | Ajax, XHR, Callbacks, ES5 promises |
ver 2 | app_ver2.js, easyhttp_ver2.js | fetch, ES6 classes, promises |
ver 3 | app_ver3.js, easyhttp_ver3.js | await async from ES7 |
To try out the different files change the link names in the html file to the file wanted:
<script src="easyhttp_ver3.js"></script>
<script src="app_ver3.js"></script>
Also uncomment the message that should be run in the app_verX.js file, from start the DELETE user is uncommented.
GET request, fetching users
POST request, adding user (id: 11)
PUT request, updating (id: 2)
DELETE request, logging delete message
- Albert Stjärne (https://github.com/AlbertStjarne)