sorry for my english.
I need to send json to another server.
Example: 127.0.0.1/api/start
In this other server i have the service that i created running, the service need to get a json
Example {"ServerId":"1","ServerPort":"27015"}
How can i do this?
I know send json with jquery, but i want know how do this using asp.net core without use jquery. is possible?
public IActionResult Start()
{
// Code here
return View();
}
I need to do this code using asp.net core
var arr = { ServerId : '1', ServerPort : '27015'};
console.log(JSON.stringify(arr));
return jQuery.ajax({
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
'type': 'POST',
'url': '13.77.102.81/Api/MTA/Start',
'data': JSON.stringify(arr),
'dataType': 'json',
'success': function (msg) {
console.log(msg);
}
});