You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and dots ('.'), can be up to 35 characters long. Letters must be lowercase.
 
 
 
 

30 lines
570 B

'use strict'
function createAgent(faction, symbol){
const data = {faction: faction, symbol: symbol}
const settings = {
async: true,
crossDomain: true,
url: 'https://api.spacetraders.io/v2/register',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
processData: false,
data: data
};
$.ajax(settings).done(function (response) {
console.log(response.data);
return response.data;
});
}
$(document).ready(function() {
let agent = createAgent("COSMIC","Fewsgereb5");
})