示例#1
0
        // Concrete Execute
        public string ExecuteQuery(string query, HttpMethod method, HttpContent httpContent, bool forceThrow = false)
        {
            if (query == null)
            {
                // When a query is null and has been generated by Tweetinvi it implies that one of the query parameter was invalid
                throw new ArgumentException("At least one of the arguments provided to the query was invalid.");
            }

            try
            {
                return(_twitterRequestHandler.ExecuteQuery(query, method, httpContent: httpContent));
            }
            catch (TwitterException ex)
            {
                if (forceThrow)
                {
                    throw;
                }

                HandleQueryException(ex);
                return(null);
            }
        }
示例#2
0
 public string ExecuteQuery(string query, HttpMethod method)
 {
     return(ExecuteQuery(query, method, null));
 }