简体   繁体   English

Httpwebrequest返回的结果超过3g / 2g而不是WiFi

[英]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.

相关问题 如何使用 xamarin Essential 确定网络类型是 2g、3g 还是 4g - how to determine if network type is 2g, 3g or 4g using xamarin essential HttpWebRequest返回与Web浏览器不同的结果 - HttpWebRequest returns different results than web browser Monotouch告诉iPad 3G和WiFi之间的区别(检查GPS) - Monotouch Tell Difference Between iPad 3G and WiFi (Check for GPS) 故障转移到3G并返回 - Failover to 3G and back 如何通过3G连接检查互联网连接状态? - How to check internet connection status over 3G connection? 有没有办法检测我正在使用什么样的连接? WiFi,3G还是以太网? - Is there a way to detect what kind of connection I'm using ? WiFi, 3G or Ethernet? 如何在Windows Phone 7中检查3G,wifi,EDGE,蜂窝网络? - How can I check for 3G, wifi, EDGE, Cellular Networks in Windows Phone 7? Google AVD和3G开启 - google avd and 3g turn on 爱立信F3507G WWAN(3G宽带)和AT命令 - Ericsson f3507g WWAN (3G Broadband) and AT commands 在桌面应用程序中的Windows 7和8中检测3G连接 - Detecting a 3G connection in Windows 7 and 8 in a desktop application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM