When using a secret with the following value (http://IP_ADDRESS:PORT/…) and a wildcard domain, passing it to HttpService:PostAsync throws an error saying ‘URL must be HTTP’. When passing a string with the same value instead of the secret, it does not throw an error.
System information:
AMD Ryzen 7 5700G
1x16GB DDR4
NVIDIA GeForce RTX 3060 Ti
Expected behavior
It should not throw an error when the URL is valid HTTP.
I added the following ServerScriptService to the game:
local HttpService = game:GetService('HttpService')
local URL = game:GetService('HttpService'):GetSecret('my_secret_url')
local data = {
['some-data'] = 123
}
local res = game:GetService("HttpService"):PostAsync(URL, data)
print(res)
I published, ran the game, and got the following error: HTTP 405 Method not allowed, which is expected.
Could you confirm whether the steps above match what you were doing?
Also, If you change your secret value to http://1.1.1.1:80, do you still see URL must be HTTP error?
Lastly, would it be okey for us to try sending POST request to the URL you provided privately?
When passing the same URL as a string instead of a secret, I get the 405 aswell.
The error seems to be reproducable with any IP address but if you’d like to use the private link, I can update it to an external link instead of a local one (the link I added is for the local network, woops). Thanks!
Looks like you are using the local secret feature: Game Settings > Security > Secrets. To set secrets through this UI, the secret value must be base64-encoded. This is documented (with example) in: Secrets stores | Documentation - Roblox Creator Hub
In this example, if you change the value to {"secretName100": ["aHR0cDovLzEuMS4xLjE6ODA=", "*"]} (where aHR0cDovLzEuMS4xLjE6ODA= is the base64 encoding of http://1.1.1.1:80) and run the game again, you should get the expected 405 error.