Search Unity

Get url text

Discussion in 'Scripting' started by Leonetienne500, Aug 26, 2019.

  1. Leonetienne500

    Leonetienne500

    Joined:
    Dec 5, 2016
    Posts:
    130
    Hi, i have to access a webapi through unity.
    The IP is running two servers. A website at 127.0.0.1:80 and the webAPI at 127.0.0.1:500.
    If i navigate to :80 via a browser i get a website. If i navigate to :500, i see this json response:

    {"Description":"Query not found","Error":404}


    So far nothing wrong. But the BIG problem is, that UnityWebRequest just gives no fck about port 500.
    Code (CSharp):
    1. UnityWebRequest.Get("127.0.0.1:500")
    just reverts back to 127.0.0.1 (my website). However i NEED it to access 127.0.0.1:500

    How do i do this?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What happens when you point your local browser to 127.0.0.1:500 ?
     
  3. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    Leonetienne500 and JeffDUnity3D like this.
  4. Leonetienne500

    Leonetienne500

    Joined:
    Dec 5, 2016
    Posts:
    130
    I get the json reply that i need
     
  5. Leonetienne500

    Leonetienne500

    Joined:
    Dec 5, 2016
    Posts:
    130
    That worked. Thanks :)