You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tutorial will explain how you can send the Request to our API using Client Side Javascript using AJAX.
consturl="https://treasurejsapi.herokuapp.com/api/v1/search?find=as";constuserAction=async()=>{constresponse=awaitfetch(url);letmyJson=awaitresponse.json();//extract JSON from the http response// do something with myJsonconsole.log(myJson);}userAction();
OUTPUT
[
{
"description":"Official React bindings for Redux",
"docs":"http://caolan.github.io/async/docs.html",
"github":"https://github.com/caolan/async",
"name":"ASYNC",
"other":[],
"website":"http://caolan.github.io/async/"
},
{
"description":"astroturf lets you write CSS in your JavaScript files without adding any runtime layer, and with your existing CSS processing pipeline.",
"docs":"",
"github":"https://github.com/4Catalyzer/astroturf",
"name":"ASTROTURF",
"other":[],
"website":""
}
]