httpwebrequest in unity3d.

Hello everybody,

I m having problem with www class. Here is .net code; which i tried and work fine for me. But now same thing i want to do with mono. I m trying it since last two days and no luck for me. So anybody having knowledge about this please help me how to do it with mono.

Here is .net code:

try
            {
                WebResponse webResponse = null;
                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://localhost:8090");
                webRequest.Method = "GET";
                webRequest.Headers.Add("HTTP_GET", "HTTP_CONTENT_PATH#");
                webResponse = webRequest.GetResponse();
                if (webResponse != null)
                {
                    string build = webResponse.Headers["LIC_BUILD"].ToString();
                   
                    string result = webResponse.Headers["CONTENT_PATH"].ToString();                           

                }
                webResponse.Close();
                webRequest = null;
            }
            catch
            { 
            //ERROR OCCUREED WHILE COMUNICATING WITH TRINFIN SERVER
            }

Humble bump once again… Can anyone please?

Hi there, why don’t you try Unity - Scripting API: WWWForm
I’ve used and it’s pretty easy. If still don’t work, you maybe have some firewall problems, or your localhost is not working on that port.

best of luck

@fano_linux,

Thank u very much for reply.

I tried all examples available in Unity documentation with whatever changes i required but no luck. My .net code work fine, so i think there is no firewall problem. Now i want to do it with Mono.

So we are meant to diagnose your problem based on the error of ‘no luck’?

@npsf3000,

no luck is from side but may be you know more then me about www and wwwform in unity3d and may be u can also tried it before me or you can have better solution for that.