Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

HttpService - PostAsync

PostAsync( string url, string data, HttpContentType content_type = ApplicationJson ) <- Copied from the Roblox WIki.

What happens if you leave the HttpContentType blank? Is it actually needed?

2 answers

✓ Accepted answer

The description of method names and parameters used in the API dumps, in the object browser and in some places on the wiki use the ANSI prototype notation. In this notation, the default values of arguments are given after the name of the argument, separated from it by an equality sign.

These default values indicate that if no value is given to the parameter, the default value will be used. The method definitions are in C++ in the ROBLOX source code, and noting the default value of a parameter in this way is a feature of C++, which I would suppose they are using (it is very unlikely they are not, since if they were not they would probably not note it in this way in the API dumps and elsewhere).

Regardless, that there is a default value (in this case, Enum.HttpContentType.ApplicationJson) indicates that the parameter is optional.

I'm not sure if this was obvious or not, but it states that it is defaulted to ApplicationJson.

This discussion is preserved as it was. New answers, comments, and votes are closed.