c# - Tumblr 头像请求

c# - Tumblr avatar request

我正在尝试获取 tumblr 用户头像的 url。问题是,我得到的不是 url,而是图像本身。这是 link 我应该从中得到 url:

api.tumblr.com/v2/blog/{blog-identifier}/avatar[/size]

这就是我尝试获取头像url的方法。 注:"item"这里是博客(例:blog.tumblr.com)

WebRequest req = WebRequest.Create("http://api.tumblr.com/v2/blog/" + item + "/avatar/");
WebResponse res = req.GetResponse();
StreamReader rd = new StreamReader(res.GetResponseStream(),Encoding.ASCII);
var end = rd.ReadToEnd();

我在论坛上看到一个回复​​说:

the /avatar route redirects you to the avatar url.

Don't follow the redirect and pull the url out of the Location header or the body of the request, which contains the same url.

但是我不知道该怎么做,你能帮我吗?有一些与我类似的问题的答案,但那些是针对不同的编程语言的。

WebRequest req = WebRequest.Create("http://api.tumblr.com/v2/blog/" + item + "/avatar/");
            WebResponse res = req.GetResponse();
            string avatarUrl = res.ResponseUri.ToString();