public object ESRI_SendWebRequest(ResultBuffer rb)
        {
            object result;

            try
            {
                TypedValue[] array = rb.AsArray();
                if (array.Count <TypedValue>() < 2)
                {
                    result = null;
                }
                else
                {
                    string text  = array[0].Value.ToString();
                    string text2 = array[1].Value.ToString();
                    if (string.IsNullOrEmpty(text))
                    {
                        result = null;
                    }
                    else if (string.IsNullOrEmpty(text2))
                    {
                        result = null;
                    }
                    else if (!Uri.IsWellFormedUriString(text2, UriKind.Absolute))
                    {
                        result = null;
                    }
                    else
                    {
                        if (!AGSConnection.bConnectionsLoaded)
                        {
                            AGSConnection.LoadConnections();
                        }
                        if (!string.IsNullOrEmpty(text2) && !Uri.IsWellFormedUriString(text2, UriKind.Absolute))
                        {
                            result = null;
                        }
                        else
                        {
                            AGSConnection aGSConnection = null;
                            foreach (AGSConnection current in App.Connections)
                            {
                                if (string.Equals(current.Name, text, StringComparison.CurrentCultureIgnoreCase))
                                {
                                    aGSConnection = current;
                                }
                            }
                            if (aGSConnection == null)
                            {
                                result = null;
                            }
                            else if (!aGSConnection.LoadConnectionProperties())
                            {
                                result = null;
                            }
                            else
                            {
                                try
                                {
                                    string text3 = aGSConnection.MakeRequest(text2);
                                    if (string.IsNullOrEmpty(text3))
                                    {
                                        if (!string.IsNullOrEmpty(aGSConnection.ErrorMessage))
                                        {
                                            result = aGSConnection.ErrorMessage;
                                        }
                                        else
                                        {
                                            result = null;
                                        }
                                    }
                                    else
                                    {
                                        result = text3;
                                    }
                                }
                                catch
                                {
                                    if (!string.IsNullOrEmpty(aGSConnection.ErrorMessage))
                                    {
                                        result = aGSConnection.ErrorMessage;
                                    }
                                    else
                                    {
                                        result = null;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }