Получаю:
{"server":627329,"photo":"[]","hash":"6ce9e707ba60a464bc45070a748dc9ec"}
private static HttpWebResponse PostMethod()
{
string url = "https://api.vk.com/method/photos.getMessagesUploadServer?&v=5.31&access_token=1234";
WebClient client = new WebClient();
string json = client.DownloadString(url);
JavaScriptSerializer json_serializer = new JavaScriptSerializer();
byte[] imageData = client.DownloadData("http://cs5530.vk.me/u43529379/-6/m_b9515ce2.jpg");
RootObject response = (RootObject)json_serializer.Deserialize(json, typeof(RootObject));
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(response.response.upload_url);
request.Method = "POST";
request.Credentials = CredentialCache.DefaultCredentials;
UTF8Encoding encoding = new UTF8Encoding();
var bytes = encoding.GetBytes(imageData.ToString());
request.ContentType = "multipart/form-data";
request.ContentLength = bytes.Length;
using (var newStream = request.GetRequestStream())
{
newStream.Write(bytes, 0, bytes.Length);
newStream.Close();
}
return (HttpWebResponse)request.GetResponse();
}