UMadara10
(IsThisErvum)
March 29, 2025, 6:34am
#1
local HTTP: HttpService = game:GetService('HttpService');
local t: { [number]: (string | (Enum.HttpContentType) | boolean) } = {
'',
(Enum.HttpContentType.ApplicationJson),
true,
};
HTTP:PostAsync(
'http://localhost:9999',
table.unpack(t),
{
['Request-Type'] = 'Status'
}
); ---> Throws: Unable to cast Dictionary to HttpContentType.
HTTP:PostAsync(
'http://localhost:9999',
t[1],
t[2],
t[3],
{
['Request-Type'] = 'Status'
}
); ---> OK.
Expected behavior
Both calls to :PostAsync() should work.
1 Like
7z99
(cody)
March 30, 2025, 8:01am
#2
This is how returning multiple values works in Lua.
https://www.lua.org/pil/5.1.html
1 Like
UMadara10
(IsThisErvum)
April 1, 2025, 12:46am
#4
I find that to be so inconvenient…
While the semantics of multiple return in Luau are indeed surprising at times, they are inherited from Lua and we cannot change them without breaking backwards compatibility for all existing code.
2 Likes
system
(system)
Closed
April 16, 2025, 10:40pm
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.