Note that there are some explanatory texts on larger screens.

plurals
  1. POProxied ajax request fails with status code 200
    primarykey
    data
    text
    <p>I'm building a js-only webapp consuming an external API through a Reverse Proxy.</p> <p>To do this I set up my Apache adding the following rules:</p> <pre><code>ProxyRequests off ProxyPassReverseCookiePath /starmobile / &lt;Location /api/&gt; ProxyPass http://209.90.224.106:7500/starmobile/ ProxyPassReverse http://209.90.224.106:7500/starmobile/ &lt;/Location&gt; &lt;Proxy *&gt; Order deny,allow Allow from all Satisfy all &lt;/Proxy&gt; </code></pre> <p>This way, all requests to /api/ are proxied to the api server, leaving all other requests to be handled locally (thus allowing to load the static resources and js).</p> <p>When performing a request through the proxy with curl everything works just fine:</p> <pre><code>curl -d "{\"method\":\"getAllItemClasses\"}" http://starcom/api/AvailabilityWebMobile/ [{"code":"Default","id":999},{"code":"06KALANCHOE","id":100041},{"code":"06BEGONIA","id":100043},{"code":"06ROSES","id":100045},{"code":"04AFRICANVIOLET","id":100046},{"code":"04CYCLAMEN","id":100047},{"code":"04ROSES","id":100048},{"code":"04ASST","id":100049},{"code":"04BEGONIA","id":100050},{"code":"04MUM","id":100051},{"code":"04KALANCHOE","id":100052},{"code":"04GERBERA","id":100053},{"code":"04PRIMROSE","id":100054},{"code":"06AZALEA","id":100055},{"code":"06CYCLAMEN","id":100056},{"code":"06MUM","id":100057},{"code":"06GERBERA","id":100058},{"code":"06HYDRANGEA","id":100059},{"code":"06ASST","id":100060},{"code":"06TULIP","id":100063},{"code":"06HYACINTH","id":100064},{"code":"06EASTERLILY","id":100065},{"code":"06SHAMROCK","id":100070},{"code":"045SHAMROCK","id":100071},{"code":"05DAHLIA","id":100194},{"code":"05OSTEO","id":100195},{"code":"06DUTCH BULBS","id":100263},{"code":"06WAVE","id":100304},{"code":"18PKWAVE","id":100305},{"code":"PTWAVE","id":100306},{"code":"2.6QTWAVE","id":100307},{"code":"16.5CLASSICA","id":100308},{"code":"10SQTBISCOTTO","id":100309},{"code":"10TALLBISCOTTO","id":100310},{"code":"13VALLEY","id":100311},{"code":"14COCOHB","id":100312},{"code":"14.5CONTESSA","id":100313},{"code":"PGR","id":100398},{"code":"FERTILIZER","id":100399},{"code":"POTS","id":100409},{"code":"SHUTTLE","id":100410},{"code":"TRAY","id":100411},{"code":"INSERT","id":100412},{"code":"FLAT","id":100413}] </code></pre> <p>However when performing the same request through ajax, I get a status code 200 OK, but an empty body. Firebug displays the 200 OK message in red, as an error, but says nothing more, and Chrome simply displays a "(canceled)" message on the status (though the detail recognizes the response header was a 200).</p> <p>I'm completely lost as to why I'm not given the body, since the proxy should prevent issues such as with the same domain policy....</p> <p>I attach the response headers as displayed by Chrome:</p> <pre><code>Connection:Keep-Alive Content-Encoding:gzip Content-Type:application/json;charset=UTF-8 Date:Wed, 15 Jun 2011 13:03:46 GMT Keep-Alive:timeout=15, max=100 Server:Apache-Coyote/1.1 Transfer-Encoding:chunked Via:1.1 starcom </code></pre> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    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