Exemplo n.º 1
0
        /// <summary>
        /// Makes a request to the Facebook server.
        /// </summary>
        /// <param name="path">
        /// The path.
        /// </param>
        /// <param name="parameters">
        /// The parameters.
        /// </param>
        /// <param name="resultType">
        /// The result type.
        /// </param>
        /// <param name="httpMethod">
        /// The http method.
        /// </param>
        /// <exception cref="Facebook.FacebookApiException"/>
        /// <returns>
        /// The json result.
        /// </returns>
        public virtual object Api(string path, IDictionary <string, object> parameters, Type resultType, HttpMethod httpMethod)
        {
            try
            {
                var facebookClient = GetFacebookClient();

                return(facebookClient.Api(path, FacebookWebClient.AddReturnSslResourceIfRequired(parameters, IsSecureConnection), httpMethod, resultType));
            }
            catch (FacebookOAuthException)
            {
                try
                {
                    _request.DeleteAuthCookie();
                }
                catch { }
                throw;
            }
        }