502: API Services rejected request with error

You can write your topic however you want, but you need to answer these questions:

  1. I can’t install Roblox studio due to my old laptop breaking and having to get a chrome book so I have to code outside of studio and send the code to my friend to implement it however it came up with “502: API Services rejected request with error. HTTP unknown error (HttpError: curl:52, Server returned nothing (no headers, no data))”

This is the code that I used:

local datastore = game:GetService("DataStoreService")
local CoinDS = datastore:GetDataStore("CoinSaveSystem")
local LevelDS = datastore:GetDataStore("LevelSaveSystem")

  local leaderstats = Instance.new("Folder", player)
  leaderstats.Name = "leaderstats"
  local coins = Instance.new("IntValue", player)
  coins.Name = "Coins"
  local level = Instance.new("IntValue", leaderstats)
  level.Name = "Level"
  level.Value = LevelDS:GetAsync(player.UserId) or 0
  LevelDS:SetAsync(player.UserId, level.Value)

  coins.Value = CoinDS:GetAsync(player.UserId) or 0
  CoinDS:SetAsync(player.UserId, coins.Value)

    LevelDS:SetAsync(player.UserId, level.Value)

    CoinDS:SetAsync(player.UserId, coins.Value)

Is this a problem with Roblox or is it just my code???
Thanks for the help!

I think you used a free model in here, go to game settings, then to security and enable Allow HTTP Requests, if this didn’t work please respond to me else if it worked solution it please! :smiley:

Game Settings -> Security


I’m not aware of there being any free models but I will try it thanks!