Hello there
I have made a asp.net web api and enabled cors.
I am trying to call from REX jsshell my web api like in postman.
Do anyone have an example of this USING JSSHELL OR SOMETHING ELSE. I am running out of ideas.
Scripts:
function RequestLogin(usr,pwd)
{
var bearer ="";
var user ={
grant_type:'password',
username:usr,
password:pwd
};
$.ajax({
type: "POST",
url: "https://DUMMY.COM/token",
data:user,
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
bearer = JSON.parse(JSON.stringify(data));
bearer = bearer.access_token;
},
failure: function (response) {
console.log(response);
},
error: function (response) {
console.log(response);
}
});
return bearer;
}
kind regards
Steen