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

**URL:** https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717
**Category:** Scripting
**Tags:** Scripting
**Created:** [November 25, 2018, 9:38am UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717 "2018-11-25T09:38:12Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![m-y](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/m-y/32/981088_2.png) [@m-y](https://discussions.unity.com/u/m-y)
#### Post date: [November 25, 2018, 9:38am UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/1 "2018-11-25T09:38:12Z")

</div>

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 :

 ![3924883--335131--upload_2018-11-25_11-37-1.png](https://europe1.discourse-cdn.com/unity/original/4X/4/e/7/4e79a885f6b39d4139d5930ae7fb6751207b1a01.png)  
But if i use The Post Function it doesn’t work at all like this :

 ![3924883--335134--upload_2018-11-25_11-37-34.png](https://europe1.discourse-cdn.com/unity/original/3X/3/b/3b0b2fde850542b0240099657e8b8169f38b1f37.png)  
So what should i do ! ? Thanks in Advance

---

<div class="post-metadata">

### Author: ![hpjohn](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@hpjohn](https://discussions.unity.com/u/hpjohn)
#### Post date: [November 25, 2018, 11:10am UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/2 "2018-11-25T11:10:56Z")

</div>

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()](http://www.SendWebRequest()), not just www

> **[Unity - Scripting API: Networking.UnityWebRequest.Post](https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.Post.html)**

> **[Unity - Manual: Sending a form to an HTTP server (POST)](https://docs.unity3d.com/Manual/UnityWebRequest-SendingForm.html)**

---

<div class="post-metadata">

### Author: ![Aurimas-Cernius](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Aurimas-Cernius](https://discussions.unity.com/u/Aurimas-Cernius)
#### Post date: [November 26, 2018, 10:32am UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/3 "2018-11-26T10:32:47Z")

</div>

> [@hpjohn](#):
>
> Looks like you need to yield return [www.SendWebRequest()](http://www.SendWebRequest()), not just www

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

---

<div class="post-metadata">

### Author: ![m-y](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/m-y/32/981088_2.png) [@m-y](https://discussions.unity.com/u/m-y)
#### Post date: [November 27, 2018, 1:59pm UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/4 "2018-11-27T13:59:42Z")

</div>

> [@Aurimas-Cernius](#):
>
> Yes. If you don’t call SendWebRequest(), well, you don’t send the request.

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](http://localhost/sqlconnect/register.php)  
but it doesn’t work with this link  
[http://localhost/fighting/public/player/register](http://localhost/fighting/public/player/register)

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

---

<div class="post-metadata">

### Author: ![Aurimas-Cernius](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Aurimas-Cernius](https://discussions.unity.com/u/Aurimas-Cernius)
#### Post date: [November 27, 2018, 2:16pm UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/5 "2018-11-27T14:16:24Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![m-y](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/m-y/32/981088_2.png) [@m-y](https://discussions.unity.com/u/m-y)
#### Post date: [November 27, 2018, 2:29pm UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/6 "2018-11-27T14:29:06Z")

</div>

> [@Aurimas-Cernius](#):
>
> 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 ! ?

---

<div class="post-metadata">

### Author: ![m-y](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/m-y/32/981088_2.png) [@m-y](https://discussions.unity.com/u/m-y)
#### Post date: [November 27, 2018, 2:30pm UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/7 "2018-11-27T14:30:41Z")

</div>

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

> <https://stackoverflow.com/questions/53501793/unity-api-not-pure-php-have-problem-to-post-how-to-solve-it>

---

<div class="post-metadata">

### Author: ![Aurimas-Cernius](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Aurimas-Cernius](https://discussions.unity.com/u/Aurimas-Cernius)
#### Post date: [November 27, 2018, 3:17pm UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/8 "2018-11-27T15:17:03Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![m-y](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/m-y/32/981088_2.png) [@m-y](https://discussions.unity.com/u/m-y)
#### Post date: [November 27, 2018, 3:21pm UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/9 "2018-11-27T15:21:26Z")

</div>

> [@Aurimas-Cernius](#):
>
> 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

---

<div class="post-metadata">

### Author: ![jdnichollsc](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jdnichollsc/32/134712_2.png) [@jdnichollsc](https://discussions.unity.com/u/jdnichollsc)
#### Post date: [September 20, 2019, 11:11pm UTC](https://discussions.unity.com/t/unity-web-request-post-function-doesnt-work-at-all/722717/10 "2019-09-20T23:11:13Z")

</div>

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 🎮](https://github.com/proyecto26/RestClient)
