commit 188b43eda477ceb171e978b6dd7cff3ce6a54953 Author: AmorimDSJM Date: Fri Nov 17 16:31:08 2023 +0100 Fixing problems in Create Agent diff --git a/index.html b/index.html new file mode 100644 index 0000000..f7d1dc1 --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + +
+ + + + + +
+ + + \ No newline at end of file diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..6c4e2f1 --- /dev/null +++ b/js/main.js @@ -0,0 +1,30 @@ +'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"); + +}) + + +