我可以使用API像这样上传匿名图片到imgur:
我可以使用API像这样上传匿名图片到imgur:
public static void UploadImage()
{
Image image = GetImage();
string base64 = Util.ImageToBase64(image);
using (WebClient client = new WebClient())
{
client.Headers.Add("Authorization", "Client-ID " + clientID);
NameValueCollection data = new NameValueCollection();
data["image"] = base64;
data["type"] = "base64";
byte[] responsePayload = client.UploadValues("https://api.imgur.com/3/image/", "POST", data);
string response = Encoding.ASCII.GetString(responsePayload);
}
}
它正在上传到一个完全随机的URL。我找不到任何文件说明如何做到这一点,但是否有可能将图片上传到用户的帐户中,以便在他们上传的图片中显示?