Skip this part, it's me rambling: Not duplicate as it didn't solve my problem and he is trying to make an ajax call as a query search.
Not a duplicate of How to make external HTTP requests with Node.js - I am not asking how to make an external http request but an ajax call.
No, I can not just use request, I don't want to get into why but ajax is the only method that'll work. I have already tested it on the client side, I just have to figure out how to implement it on the server side.
ACTUAL QUESTION
$.ajax({
url: "https://example/api/card/",
dataType: "JSONP",
type: "GET",
jsonpCallback: "callback",
data: {
id: var1,
scid: var2,
cid: var34
},
success: function() { console.log("res", res) }
});
I need to somehow make the above ajax call from the server side of my nodejs application.
I HAVE to use ajax as the api I am sending it to only accepts a specific kind of request that I am trying to mimic.