[英]Httpwebrequest returns different results over 3g/2g than WiFi
I have written an app which crawls a certain website for information. 我写了一个应用程序,抓取某个网站的信息。
Over WiFi or in my emulator it works perfectly. 通过WiFi或我的模拟器,它完美地工作。
I carry out a httpwebrequest, and read each line and put them into a list, I can then loop through this list and find the data I need. 我执行一个httpwebrequest,读取每一行并将它们放入一个列表中,然后我可以遍历此列表并找到我需要的数据。
However, when I try the same thing over 2G or 3G the web request return all the HTML in a single line, which breaks all my code. 但是,当我在2G或3G上尝试相同的事情时,Web请求会在一行中返回所有HTML,这会破坏我的所有代码。
Does anyone know why it is doing this or if there is anyway for me to get around this without rewriting most of my code. 有没有人知道它为什么这样做或者无论如何我都可以解决这个问题而不重写我的大部分代码。
Your provider is most likely intercepting your request and removing all unnecessary characters from it, to speed up the internet connection and to produce less traffic. 您的提供商很可能会截取您的请求并从中删除所有不必要的字符,以加快互联网连接并减少流量。 That is common practice. 这是常见的做法。 If this breaks your code, then you rather should identify why removing white-spaces and characters like this breaks your code. 如果这会破坏您的代码,那么您应该确定为什么删除空格和这样的字符会破坏您的代码。
There is nothing you can do about this. 你无能为力。 You should rewrite your code to be less restrictive. 您应该重写代码以减少限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.