Tony Johansson
2016-03-08 19:48:34 UTC
Background: I have a node.js API that use json to send and receive message
from client. I want to use the built in unit test that exist in visual
studio to test the API. I know I can use for exampel postman to test the API
but I need a a quich and reliable way to test 6 different rest API. If I get
some help with this one I can manage the other five myself.
$.ajax({
type: 'GET',
url: 'http://diseserver.net/api/v1/users/1',
dataType: 'json',
async: false,
headers: {
'Authorization': 'Basic ' + btoa('DEFAULT/user:password')
},
success: function(response) {
//your success code
console.log(response);
},
error: function (err) {
//your error code
console.log(err);
}
});
//Tony
from client. I want to use the built in unit test that exist in visual
studio to test the API. I know I can use for exampel postman to test the API
but I need a a quich and reliable way to test 6 different rest API. If I get
some help with this one I can manage the other five myself.
$.ajax({
type: 'GET',
url: 'http://diseserver.net/api/v1/users/1',
dataType: 'json',
async: false,
headers: {
'Authorization': 'Basic ' + btoa('DEFAULT/user:password')
},
success: function(response) {
//your success code
console.log(response);
},
error: function (err) {
//your error code
console.log(err);
}
});
//Tony