Note that there are some explanatory texts on larger screens.

plurals
  1. PO.Net HttpListenerRequest response is not working with Ajax in chrome
    primarykey
    data
    text
    <p>In my code I am doing the following:</p> <pre><code> response.ContentType = "text/xml"; StringWriter stringToWrite = new StringWriter(); respose_example = getData(); System.Xml.Serialization.XmlSerializer outSeralizeList = new System.Xml.Serialization.XmlSerializer(typeof(List&lt;Registers&gt;)); outSeralizeList.Serialize(stringToWrite, respose_example); string responseString = stringToWrite.ToString(); // Construct a response. response.ContentEncoding = System.Text.Encoding.UTF8; byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString); // Get a response stream and write the response to it. response.ContentLength64 = buffer.Length; Stream output = response.OutputStream; output.Write(buffer, 0, buffer.Length); // You must close the output stream. output.Close(); </code></pre> <p>In my browser code I am doing the following:</p> <pre><code>xmlhttp.open("POST", "", false); var command = new commandObject(); command.command = "xml"; try { xmlhttp.send(JSON.stringify(command)); } catch(e){ alert(e); } </code></pre> <p>I keep getting this error:</p> <pre><code>DOMException {message: "A network error occurred.", name: "NetworkError", code: 19, stack: "Error: A network error occurred.↵ at getXML (ht…rElement.onclick (http://127.0.0.1:7000/:403:164)", INDEX_SIZE_ERR: 1…} code: 19 message: "A network error occurred." name: "NetworkError" stack: "Error: A network error occurred.↵ at getXML (http://127.0.0.1:7000/:84:19)↵ at create_table (http://127.0.0.1:7000/:182:22)↵ at HTMLAnchorElement.onclick (http://127.0.0.1:7000/:403:164)" __proto__: DOMException </code></pre> <p>Not sure why it works on in FF. I wish chrome would give more details.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload