'Why error 500 response in pterodactyl api?
I'm making a system that could create a pterodactyl user account with the given variable. I used the fetch function(POST) in js to create the request. But whenever it submits, an error 500 appears in the console log. I'm just wondering how to fix it
Code:
fetch('https://corsproxy.io/?' + encodeURIComponent('https://servers.chynodes.xyz/api/application/users'), {
"method": "POST",
"headers": {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer api_key", //i replaced the api key with that for safety reasons
"cookie": "pterodactyl_session=eyJpdiI6ImlHS1Y5VGdPTXJPb2FMVDRBYWw3Y3c9PSIsInZhbHVlIjoiSW1Ra1dEakUrZjRGZzEzcXRRTWkraUc2N3ZsL0F4Ym9QVFgxWTMyYTg1cDRiM0srS0ZvWlBOZCt6Wk0vNW1meTVud0pIaU5YNW1pRFIrYTZGQ3o4Wm4weERteHVJaVBrRmcyS2l3WTVISEsvOUJoaTV0MWxNWkYwOEtMd082bVUiLCJtYWMiOiI3NmVmNDk3MzNiNWNjMzhlOTliMzQxNjFjMjUyOGI1N2U2ZWU2OWQ1ZGJlZWE3NjlmZDRkMTdmMjBmMjI2YWM2In0%3D"
},
"body": {
"email": "[email protected]",
"username": "exampleusername",
"first_name": "Exam",
"last_name": "Ple"
}
})
.then(response => console.log(response))
.catch(err => console.error(err));
I used corsproxy.io to bypass cors without any fuss
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
