Note that there are some explanatory texts on larger screens.

plurals
  1. POCFHTTP Encoding Problem
    text
    copied!<p>I am trying to pull a page for parsing information out of it using cfhttp. The page headers that I am calling are:</p> <blockquote> <p>Content-Encoding: gzip</p> <p>Connection: Keep-Alive</p> <p>Content-Length: 19066</p> <p>Server: IBM_HTTP_Server</p> <p>Vary: Accept-Encoding, User-Agent</p> <p>Content-Language: en-US</p> <p>Cache-Control: no-cache="set-cookie,</p> <p>set-cookie2"</p> <p>Content-Type:</p> <p>text/html;charset=ISO-8859-1</p> </blockquote> <p>I set the charset to ISO-8859-1 however I am getting the following in the FileContent (only a small sample is shown below but I think it gets to point across).</p> <blockquote> <p>EðÑq·Oã?·Ì\ZóL¯þ´Vú5ðbä£ÿæ¾_HÉÒñQãO\Çþãë85ÁÜ à±°ùÖ}&amp;bßý?,u?2SùQyk5g?UÛ3Ѹfã×ARÃi_iûRã _ òCA¿-ß.<code>"b /¯ßíWÝÆ´}w~,°iøÜCáÇþ@ÃZ5¤ïsÁ8½°ì* ZÜéjOÝK/Ë4§ÈG5×ä*¬6ÚwÇ0]ã:àÑþé¬G"ÅÁl/t° jlá»5¶&amp;¯lìYìºØ'yDð½|#ý&lt;ñìTé%¾ï¬ùƪx¶}«±o9»ë¼ÂÆÒï'w8Y?</code>÷ðxsllû 6íqüGÞsÜóÀx·ªk®XºàåZ{íÁ½åo÷mbq¥ÝÃ8M</p> </blockquote> <p>I tried other charsets and was considering the gzip encoding to be causing the problem but I am unsure how the test if that is the issue. Any suggestions or help would be greatly valued.</p> <p>Below is my Code</p> <pre><code>&lt;cfhttp METHOD="get" throwonerror="yes" CHARSET="ISO-8859-1" URL="http://www.cars.com/for-sale/searchresults.action?sf1Dir=DESC&amp;prMn=1&amp;crSrtFlds=stkTypId-feedSegId-pseudoPrice&amp;rd=100000&amp;zc=44203&amp;PMmt=0-0-0&amp;stkTypId=28881&amp;sf2Dir=ASC&amp;sf1Nm=price&amp;sf2Nm=miles&amp;feedSegId=28705&amp;searchSource=UTILITY&amp;pgId=2102&amp;rpp=10"&gt; &lt;cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0"&gt; &lt;cfhttpparam type= "Header" name= "TE" value= "deflate;q=0" &gt; &lt;/cfhttp&gt; &lt;cfset listings = #cfhttp.FileContent#&gt; &lt;cfoutput&gt; #listings# &lt;/cfoutput&gt; </code></pre> <p>I have also tried the headers:</p> <pre><code> &lt;cfhttpparam type="Header" name="Accept-Encoding" value="*"&gt; &lt;cfhttpparam type= "Header" name= "TE" value= "deflate;q=0" &gt; </code></pre> <p>And tried removing the 'Accept-Encoding' header and just leaving the TE.</p> <p><strong>UPDATE:</strong> I still havn't figured it out, but I found something that might help someone help me out. When I used a test php server of mine to run file_get_contents on the same page and it worked fine, then if I ran the same cfhttp code to call the php page that was calling the page I need it worked just fine. Thanks for the suggestions so far.</p>
 

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