Unity Web Request Post Function Doesn't Work at all?

what i am trying to do is to Post Request using Unity web request library , Everything is work well if i use WWW Library like this :


But if i use The Post Function it doesn’t work at all like this :


So what should i do ! ? Thanks in Advance

I’ve seen several examples of UnityWebRequest.Post in quick googles, and your code does not quite match their basic function
Looks like you need to yield return www.SendWebRequest(), not just www

Yes. If you don’t call SendWebRequest(), well, you don’t send the request.

2 Likes

Thanks For Your Answer it solved the problem
But
i have another Big problem now
the API doesn’t have .php Extension
i was testing only using pure php
But now the API that web developer created
is not pure it is using laravell
so everything is working with this Link
http://localhost/sqlconnect/register.php
but it doesn’t work with this link
http://localhost/fighting/public/player/register

So how Can i make the post method work with this link ?
thanks

What does it mean “it doesn’t work with other link”?
You have to pass correct link to UnityWebRequest and use correct method, maybe set some headers for authentication. Otherwise look what error you get.

Really it doesn’t work with the other link
the two links tested and successully work on the web browser
the first one is working well with the Post Method
but the Second one doesn’t Work with the Post Method
the first one i created using Pure PHP
But the Second one is created with larvell with php
so the syntax link is a little different
so i don’t know how to solve it ! ?

You Can see the Full question i just posted here on stackoverflow

I can only give you the same answer you received there: check for errors on UWR and see what error property returns. The clue is there.

there is Any resources (Video / Article ) Anything not use .php link and tested
i want to see the steps they did to success
cause all resources on internet used .php syntax

Try using this other asset to avoid Coroutines and callback hell using promises instead GitHub - proyecto26/RestClient: 🦄 A Promise based REST and HTTP client for Unity 🎮