Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7967701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:57:53+00:00 2026-06-04T06:57:53+00:00

I have some method to comunity with server, But when i use www in

  • 0

I have some method to comunity with server, But when i use www in a function in class -> it doesn’t run , to check i use www like with code i use in class –> it run.. I don’t know what’s happening, please help me!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:57:54+00:00Added an answer on June 4, 2026 at 6:57 am

    Create a new class that does inherit MonoBehaviour, then call that.

    Example of Javascript(unity) way
    // Get the latest webcam shot from outside “Friday’s” in Times Square
    var url = “http://images.earthcam.com/ec_metros/ourcams/fridays.jpg”;
    function Start () {
    // Start a download of the given URL
    var www : WWW = new WWW (url);

        // Wait for download to complete
        yield www;
    
        // assign texture
        renderer.material.mainTexture = www.texture;
    }
    

    [EDIT] Example of C# way

    /// Gets the response.
    /// 
    /// <param name="StrURL">The URL.
    /// HTML source
    public string GetResponse(string StrURL)
    {
        string strReturn = "";
        HttpWebRequest objRequest = null;
        IAsyncResult ar = null;
        HttpWebResponse objResponse = null;
        StreamReader objs = null;
        try
        {
    
            objRequest = (HttpWebRequest)WebRequest.Create(StrURL);
            ar = objRequest.BeginGetResponse(new AsyncCallback(GetScrapingResponse),     objRequest);
    
            //// Wait for request to complete
            ar.AsyncWaitHandle.WaitOne(1000 * 60, true);
            if (objRequest.HaveResponse == false)
            {
                throw new Exception("No Response!!!");
            }
    
            objResponse = (HttpWebResponse)objRequest.EndGetResponse(ar);
            objs = new StreamReader(objResponse.GetResponseStream());
            strReturn = objs.ReadToEnd();
        }
        catch (Exception exp)
        {
            throw exp;
        }
        finally
        {
            if (objResponse != null)
            objResponse.Close();
            objRequest = null;
            ar = null;
            objResponse = null;
            objs = null;
        }
        return strReturn;
    }
    
    /// Gets the scraping response.
    ///
    /// <param name="result">The result.
    protected void GetScrapingResponse(IAsyncResult result)
    {
        //here you will need to cast/parse the response into what ever type you require e.g. a texture, an xml file, an asset bundle, ect.
    }
    

    Call like so

    GetResponse('http://images.earthcam.com/ec_metros/ourcams/fridays.jpg');   
    

    [Edit]

    Basicly Javascript files in Unity automatically inherit from MonoBehavior.

    If you are absolutly certain you cant/wont just create a class that inherits monobehaviour (Example #1) to do the work for you, then your asking how to do a normal XMLHttpRequest to a url.

    Javascript Example here:

    var xmlHttp = null;
    
    function GetServerInfo()
    {
        var Url = "http://localhost";
    
        xmlHttp = new XMLHttpRequest(); 
        xmlHttp.onreadystatechange = ProcessRequest;
        xmlHttp.open( "GET", Url, true );
        xmlHttp.send( null );
    }
    
    function ProcessRequest() 
    {
        if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 ) 
        {
            if ( xmlHttp.responseText == "Not found" ) 
            {
    
            }
            else
            {
                var info = eval ( "(" + xmlHttp.responseText + ")" );
                //Here is where it will get super tricky. You will need to parse these objects into unity objects.
            }                    
        }
    }
    

    The really complicated part of this is you will need to parse your http response into unity objects…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code in method C that will get executed based upon the
I have a class with some method that depend by one parameter. What is
I have some code which asserts an exception is thrown when a method is
I have some class that I'm passing as a result of a service method,
I have some code, which uses the ExecuteStmt method on the Axapta Object when
Say I have some method like so: public void Method<T>(Func<T> func) { ... }
I have some method about user statistics to run just before CI session expires.
I have some logic in a method that operates on a specified type and
I have some XML that I want to parse using the lxml method in
I have some difficulties for using Ruby block, passing in a method. As in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.