Esempio n. 1
0
 public static void trackWWWSend(string prefix, WWW www, Dictionary <string, string> headers)
 {
     ASync.StartCoroutine(ASync.WWWEnumerator(www).afterThis(() => {
         if (!string.IsNullOrEmpty(www.error))
         {
             if (Log.isInfo)
             {
                 Log.info(
                     prefix + " send failed with: " + www.error +
                     "\nRequest headers=" + headers.asString() +
                     "\nResponse headers=" + www.responseHeaders.asString()
                     );
             }
         }
         else
         {
             if (Debug.isDebugBuild && Log.isInfo)
             {
                 Log.info(
                     prefix + " send succeeded with response headers=" + www.responseHeaders.asString()
                     );
             }
         }
     }));
 }
Esempio n. 2
0
 public static void trackWWWSend(this WWW www, string prefix, WWWForm form)
 {
     ASync.StartCoroutine(ASync.WWWEnumerator(www).afterThis(() => {
         if (!string.IsNullOrEmpty(www.error))
         {
             if (Log.isInfo)
             {
                 Log.info(
                     $"{prefix} POST send to '{www.url}' failed with: {www.error}" +
                     "\nRequest headers=" + form.headers.asDebugString() +
                     "\nRequest body=" + Encoding.UTF8.GetString(form.data) +
                     "\nResponse headers=" + www.responseHeaders.asDebugString()
                     );
             }
         }
         else
         {
             if (Debug.isDebugBuild && Log.isInfo)
             {
                 Log.info(
                     prefix + " POST send succeeded with response headers=" + www.responseHeaders.asDebugString()
                     );
             }
         }
     }));
 }