You are getting this error because you are trying to access a roblox resource.(ROBLOX api endpoints, ROBLOX servers, etc.) In this case the URL is your localhost, the problem with this is I believe roblox detects that the server you are trying to connect to(your computer aka localhost) which is also running a roblox game server emulation(thats how you test stuff in studio - you host your own emulated roblox server)) and denies the request.
localhost refers to the current computer that acts as the host. So, what you’re actually doing is sending a request from the roblox server to itself, where the path /up doesn’t exist but you can’t send http requests to roblox’s domain / resources, which is where the error comes in.
If you do want roblox’s servers to access it, you would need to buy a domain name from a domain registrar and look for hosting services
I understand the issue but is there any way to get around it?
I would need to spare extra resources to test my API otherwise and it would mess up my whole workflow.
localhost is used locally on your PC as a reference word. For the Roblox server, localhost would be accessing local scripts and other backround resources. You need to host your API on a cloud and get a link from there.
The only way to get around this would be to send an HTTP request to a remote server and have that remote server relay it to you own computer(localhost) like a proxy, but this wouldnt work on an actual roblox server if you used this in a game becuase you wouldnt be able to communicate with other parts of the server other than the game part.