Answer the question
In order to leave comments, you need to log in
C#. Why does the VK API return "photo":"[]"?
I get:
{"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();
}
Answer the question
In order to leave comments, you need to log in
input and its absolutely positioned label, all wrapped in a div.
Either outside the label, and inside the span.
Writing "email adress ..." in a pseudo-element is not appropriate.
Something like this: https://jsfiddle.net/m7hcbdrj/ colors, indents change as you need
wrap the input in a div and apply pseudo-elements to it to display the caption on top
Use Fiddler and proxy all requests through it - this will help you quickly understand what the error is.
To get started, try loading the file in the browser on the method page and see how the request is formed in Fiddler, then check how your code works. The error will be visible almost immediately
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question