예제 #1
0
    public static IEnumerator SendPost(string _url, WWWForm _wForm, HandleHttpResponse fun)
    {
        WWW postData = new WWW(_url, _wForm);

        yield return(postData);

        if (fun != null)
        {
            fun(postData);
        }
        if (postData.error != null)
        {
            Debug.Log(postData.error);
        }
        else
        {
            Debug.Log(postData.text);
        }
    }
예제 #2
0
    public static IEnumerator SendGet(string _url, HandleHttpResponse fun)
    {
        WWW getData = new WWW(_url);

        yield return(getData);

        if (fun != null)
        {
            fun(getData);
        }

        if (getData.error != null)
        {
            Debug.Log(getData.error);
        }
        else
        {
            Debug.Log(getData.text);
        }
    }