NETWORK_ERR: XmlHttpRequest Exception 101 in Android

后端 未结 1 936
半阙折子戏
半阙折子戏 2021-01-21 16:50

I am developing a mobile application for android mobile.When ever I run it I get the following error: network_err xmlhttprequest exception 101. Can anyone please clarify? I am u

相关标签:
1条回答
  • 2021-01-21 17:55

    CrossDomain XMLHttpRequest? I and others have been this (seemingly undocumented exception) when doing cross domain XMLHttpRequests. Most requests you make with XMLHttpRequest will be cross domain (ie to a server other than the one from which the HTML for the page was loaded) -- because the domain you loaded from is the local file system (file:) Android/Webkit can have some white listed domains, but that is probably not what you want to do.

    Typically cross domain use of XMLHttpRequest (which has only been permitted in recent years) requires that the server that you are going to, permits the request. This is done by having the server return an HTTP header: Access-Control-Allow-Origin: * (etc, See information about cross domain XMLHttpRequest)

    I've seen this exception show up on Android 2.3.5/Webkit 553.1 with valid cross domain requests that have been repeated (caching bug?). Others have reported it on cross domain requests where the response was invalid XML.

    Check what protocol (http vs https, etc) what host and what port (usually 80) you attempting to send requests to.

    0 讨论(0)
提交回复
热议问题