Ad
Log in to vote
3

HttpService - PostAsync [closed]

Asked by 3 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 Everesty

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

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

2 answers

Log in to vote
6
Answered by 3 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
nox7 755
3 years ago

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

Ad