POST Data from HTTPService doesn't come to PHP

Hello!

I tried using the PostAsync method of HTTPService.
However, the POST data doesn’t seem to reach PHP.

I then tried to search the problem on the DevForum & Google, and here’s the only result:

and of course, its solution is (in a nutshell): “idk lol use get” which is very inefficient when you have multiple parameters and spaces in parameters.

So, does any web dev has a solution for me? I’ve tried everything from CORS in PHP to CORS in .htaccess to disabling any sort of cache or something.

Thanks in advance!

Ah yes, I made that post. I have figured out the exact problem

1 Like

When you’re sending the post request to the url make sure you send in the http content type application/x-www-form-urlencoded.

By default, if you don’t pass the third parameter of HttpsService:PostAsync() it will be application/json.

I don’t know if this will completely work for you as after that post I migrated to Node.js.

The data passed to $_POST[] is application/x-www-form-urlencoded so it would make sense not to work if you didn’t pass the 3rd argument of PostAsync. This is a common mistake developers make while trying to incorporate third party services in their games.

Hope this helps :slight_smile:

2 Likes