Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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

Discussion in 'Scripting' started by m-y, Nov 25, 2018.

  1. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    470
    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 :
    upload_2018-11-25_11-37-1.png
    But if i use The Post Function it doesn't work at all like this :

    upload_2018-11-25_11-37-34.png
    So what should i do ! ? Thanks in Advance
     
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
  3. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    Yes. If you don't call SendWebRequest(), well, you don't send the request.
     
    m-y and Kurt-Dekker like this.
  4. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    470
    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
     
  5. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    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.
     
  6. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    470
    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 ! ?
     
  7. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    470
  8. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    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.
     
  9. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    470
    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
     
  10. jdnichollsc

    jdnichollsc

    Joined:
    Sep 23, 2017
    Posts:
    9