{\"meta\":{\"status\":401,\"msg\":\"Unauthorized\"},\"response\":[]}

93 views
Skip to first unread message

Nahush Shrestha

unread,
Apr 11, 2017, 5:46:27 AM4/11/17
to Tumblr API Discussion
    public async Task PostTumble()
        {
            
            var oauth = new Manager();
            oauth["consumer_key"] = "UgUNVzBrOWJ3ynIlyKWockrEtnN4tD6BQL8f3AkLuvOgkETkxc";
            oauth["consumer_secret"] = "rsDIF1XaKaD6kBS5kpdIW0a7u2fbCrSPPwwMJFyWzLHE0rCBfS";
            oauth["token"] = "05Dv6QDWeDCWUtipU1HLvltcAx5MUmrbAhGJ480C0dEyhzdiNj";
            oauth["token_secret"] = "Ek68in5wDBHkaIAbVLIOWHYPcc3g3yEXhk1EA1LGj1k7GmSVHD";
            // now, update tumblr status using that access token
            var appUrl = "https://api.tumblr.com/v2/blog/nahush/post";
            var authzHeader = oauth.GenerateAuthzHeader(appUrl, "POST");
           var abc = Encoding.UTF8.GetEncoder();
            using (var multiContent = new MultipartFormDataContent())
            {
            multiContent.Add(new StringContent(JsonConvert.SerializeObject("asjdgjahgds"), Encoding.UTF8, "application/x-www-form-urlencoded"), "body");
            using (HttpClient client = new HttpClient())
                {
                    client.BaseAddress = new Uri(appUrl);
                    client.DefaultRequestHeaders.Add("Authorization", authzHeader);
                    var data = await client.PostAsync("", multiContent);
                    var response = await data.Content.ReadAsStringAsync();

                }

               
            }

        }
errror {\"meta\":{\"status\":401,\"msg\":\"Unauthorized\"},\"response\":[]}



when i try to post something 
what is the solution for this
Reply all
Reply to author
Forward
0 new messages