Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
17

HttpService - PostAsync [closed]

Asked by 10 years ago

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?

Locked by TheGuyWithAShortName and User#2

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
6
Answered by 10 years ago

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.

Ad
Log in to vote
0
Answered by
MrNicNac 855 Moderation Voter
10 years ago

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