FlickrNet.TwitterResponder.GetDataResponseAsync C# (CSharp) Méthode

GetDataResponseAsync() public static méthode

Gets a data response for the given base url and parameters, either using OAuth or not depending on which parameters were passed in.
public static GetDataResponseAsync ( Twitter flickr, string method, string baseUrl, string>.Dictionary parameters ) : Task>
flickr Twitter The current instance of the class.
method string
baseUrl string The base url to be called.
parameters string>.Dictionary A dictionary of parameters.
Résultat Task>
        public async static Task<FlickrResult<string>> GetDataResponseAsync(Twitter flickr, string method, string baseUrl, Dictionary<string, string> parameters)
        {
            bool oAuth = parameters.ContainsKey("oauth_consumer_key");

            if (oAuth)
                return await GetDataResponseOAuthAsync(flickr, method, baseUrl, parameters);
            else
                return await GetDataResponseNormalAsync(flickr, baseUrl, parameters);
        }

Usage Example

        /// <summary>
        /// Get an <see cref="OAuthRequestToken"/> for the given callback URL.
        /// </summary>
        /// <remarks>Specify 'oob' as the callback url for no callback to be performed.</remarks>
        /// <param name="callbackUrl">The callback Uri, or 'oob' if no callback is to be performed.</param>
        /// <param name="callback"></param>
        public async Task <FlickrResult <OAuthRequestToken> > OAuthGetRequestTokenAsync(string callbackUrl)
        {
            string url = RequestTokenUrl; //"https://www.flickr.com/services/oauth/request_token";

            Dictionary <string, string> parameters = OAuthGetBasicParameters();

            parameters.Add("oauth_callback", callbackUrl);

            string sig = OAuthCalculateSignature("POST", url, parameters, null);

            parameters.Add("oauth_signature", sig);

            FlickrResult <string> r = await TwitterResponder.GetDataResponseAsync(this, "POST", url, parameters);

            FlickrResult <OAuthRequestToken> result = new FlickrResult <OAuthRequestToken>();

            if (!r.HasError)
            {
                result.Result = FlickrNet.OAuthRequestToken.ParseResponse(r.Result);
            }
            else
            {
                result.HasError     = r.HasError;
                result.Error        = r.Error;
                result.ErrorCode    = r.ErrorCode;
                result.ErrorMessage = r.ErrorMessage;
            }

            return(result);
        }
All Usage Examples Of FlickrNet.TwitterResponder::GetDataResponseAsync