AllegroGraphCSharpClient.Request.StandardRequest C# (CSharp) Method

StandardRequest() public method

Most common way to talk to the server
public StandardRequest ( string method, string url, List options, string contentType ) : List
method string
url string
options List
contentType string
return List
        public List<Results> StandardRequest(string method, string url, List<NameValuePairs> options, string contentType)
        {
            List<Results> results = new List<Results>();

            try
            {
                if (contentType == string.Empty)
                    results = makeRequest(method, url, options, string.Empty, "application/json");
                else
                    results = makeRequest(method, url, options, string.Empty, contentType);
            }
            catch (Exception ex)
            {

                System.Diagnostics.Trace.WriteLine("Error in JSONRequest: " + ex.Message);
            }
            return results;
        }

Usage Example

Beispiel #1
0
        /// <summary>
        /// List the triple stores at the current url
        /// </summary>
        /// <returns></returns>
        public List <string> listTripleStores(string url)
        {
            if (url != string.Empty)
            {
                this._url = url;
            }
            List <string> stores = new List <string>();

            try
            {
                Request        request = new Request();
                List <Results> rs      = new List <Results>();
                rs = request.StandardRequest("GET", this._url + @"/repositories", null, null);
                foreach (Results result in rs)
                {
                    stores.Add(result.Result.ToString());
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine("Error in listTripleStores : " + ex.Message);
            }

            return(stores);
        }
All Usage Examples Of AllegroGraphCSharpClient.Request::StandardRequest