0

If you open https://de.wikipedia.org/w/api.php?action=query&titles=Tannen&prop=revisions&rvprop=timestamp|content&format=xml in your browser, all is fine. But if I get this URL using the http client, the very last three bytes are messed up:

var response = httpclient.GetAsync ("https://de.wikipedia.org/w/api.php?action=query&titles=Tannen&prop=revisions&rvprop=timestamp|content&format=xml").Result;
string sResponse = response.Content.ReadAsStringAsync ().Result;

The length of the response document is 65533 Bytes and therefore nearly 2^16 Bytes - maybe this is the source of the problem. The same code worked thousends of times before with other documents, but in this specific case, it fails. What's wrong?

André
  • 405
  • 5
  • 16
  • what encoding options are you using.. I am quite sure it's an invalid character issue in regards to the `|` symbol would the answer in this posting help - http://stackoverflow.com/questions/12236687/how-to-change-the-encoding-of-the-httpclient-response/12237870#12237870 – MethodMan Apr 26 '16 at 18:53
  • It's all UTF8, but this is not the problem, because it works for nearly all other Wikipedia pages. I'm nearly sure that this is NO encoding issue. I already tried using GetByteArrayAsync (), but this fails too. The three last bytes of the returned array are not the expected ones. – André Apr 26 '16 at 19:00

0 Answers0