I'm attempting to log the concatenated url in the console, but so far my attempts have not been successful. I've tried creating a new variable and passing it to console.log with no luck.
How can I get a log of the url I am trying to post?
$scope.sendPaymentConfirmation = function (ordernumber) {
//function sendPaymentConfirmation(ordernumber) {
$http({
url: ('http://example.com/api/' + ordernumber), //'http://samedomain.com/GetPersons',
var posturl = url;
console.log(posturl);
method: "POST",
//data: postData,
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
.then(function(response) {
// success : Thankyou, payment confirmation has been sent to the API server
window.alert('SUCCESS - Payment confirmation has been sent to the API server');
},
function(response) { // optional
// failed : ERROR There has been an error sending payment confirmation to the API server
window.alert('ERROR - There has been an error sending payment confirmation to the API server');
}
);
}