我能匿名上傳影像使用API像這樣imgur:如何上傳到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);
}
}
它上傳到一個完全隨機的網址。我找不到任何文檔顯示如何執行此操作,但是可以將圖像上傳到用戶的帳戶,以便它顯示在他們上傳的圖像中?