<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>jingyen.com</title> <atom:link href="http://www.jingyen.com/feed/" rel="self" type="application/rss+xml" /><link>http://www.jingyen.com</link> <description>in the life of a burnt out programmer :: jeff cheung</description> <lastBuildDate>Mon, 18 Jul 2011 18:07:15 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>The server committed a protocol violation. Section=ResponseStatusLine</title><link>http://www.jingyen.com/the-server-committed-a-protocol-violation-sectionresponsestatusline/</link> <comments>http://www.jingyen.com/the-server-committed-a-protocol-violation-sectionresponsestatusline/#comments</comments> <pubDate>Mon, 18 Jul 2011 18:04:59 +0000</pubDate> <dc:creator>Jeff Cheung</dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Code]]></category> <guid
isPermaLink="false">http://www.jingyen.com/?p=53</guid> <description><![CDATA[I&#8217;ve reused my HttpWebRequest library over and over before when automating posts to webservers, webservices, etc. I&#8217;ve come across this error, &#8220;The server committed a protocol violation. Section=ResponseStatusLine&#8221;, many times before. In the past frameworks (1.1, specifically), all I had to do was add &#60;system.net&#62; &#60;settings&#62; &#60;httpWebRequest useUnsafeHeaderParsing="true"/&#62; &#60;/settings&#62; &#60;/system.net&#62; to the web.config or app.config, [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve reused my HttpWebRequest library over and over before when automating posts to webservers, webservices, etc.  I&#8217;ve come across this error, &#8220;The server committed a protocol violation. Section=ResponseStatusLine&#8221;, many times before.  In the past frameworks (1.1, specifically), all I had to do was add <code><br
/> &lt;system.net&gt;<br
/> &lt;settings&gt;<br
/> &lt;httpWebRequest useUnsafeHeaderParsing="true"/&gt;<br
/> &lt;/settings&gt;<br
/> &lt;/system.net&gt;<br
/> </code> to the web.config or app.config, depending on my application.  There were some instances where I had to set the KeepAlive property to false.  Recently, in a project of mine, none of these things worked.  The only thing that seemed to have any effect on the error was setting the ProtocolVersion back to 1.0.  Weird&#8230;<br
/> <code><br
/> public static string Post(CookieContainer incookies, out CookieContainer outcookies, string Url, string data, string Referer, out string outUrl)<br
/> {<br
/> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);<br
/> request.CookieContainer = incookies;<br
/> request.Method = WebRequestMethods.Http.Post;<br
/> request.Referer = Referer;<br
/> request.ContentType = "application/x-www-form-urlencoded";<br
/> request.ProtocolVersion = HttpVersion.Version10;<br
/> request.ContentLength = data.Length;<br
/> request.KeepAlive = false;<br
/> StreamWriter writer = new StreamWriter(request.GetRequestStream());<br
/> writer.Write(data);<br
/> writer.Close();<br
/> HttpWebResponse response = (HttpWebResponse)request.GetResponse();<br
/> StreamReader reader = new StreamReader(response.GetResponseStream());<br
/> string output = reader.ReadToEnd();<br
/> outUrl = response.ResponseUri.ToString();<br
/> response.Close();<br
/> request = null;<br
/> response = null;<br
/> outcookies = incookies;<br
/> return output;<br
/> }<br
/> </code></p> ]]></content:encoded> <wfw:commentRss>http://www.jingyen.com/the-server-committed-a-protocol-violation-sectionresponsestatusline/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Prediction API</title><link>http://www.jingyen.com/prediction-api/</link> <comments>http://www.jingyen.com/prediction-api/#comments</comments> <pubDate>Tue, 17 May 2011 05:33:35 +0000</pubDate> <dc:creator>Jeff Cheung</dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Code]]></category> <guid
isPermaLink="false">http://www.jingyen.com/?p=51</guid> <description><![CDATA[Really looking forward to start playing with Google&#8217;s Prediction API. I&#8217;m really hoping time will allow me to come up with something useful with it.]]></description> <content:encoded><![CDATA[<p>Really looking forward to start playing with <a
href="http://code.google.com/apis/predict/">Google&#8217;s Prediction API</a>.  I&#8217;m really hoping time will allow me to come up with something useful with it.</p> ]]></content:encoded> <wfw:commentRss>http://www.jingyen.com/prediction-api/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Resurrection</title><link>http://www.jingyen.com/resurrection/</link> <comments>http://www.jingyen.com/resurrection/#comments</comments> <pubDate>Sun, 15 May 2011 21:28:57 +0000</pubDate> <dc:creator>Jeff Cheung</dc:creator> <category><![CDATA[News]]></category> <guid
isPermaLink="false">http://www.jingyen.com/?p=47</guid> <description><![CDATA[After almost 6 years, I finally got around to bringing this site up back from the dead. I&#8217;ve been busy with various projects and running my own CRM company that I haven&#8217;t truly had time to focus on new technology. This new site awakening is an effort to remedy that.]]></description> <content:encoded><![CDATA[<p>After almost 6 years, I finally got around to bringing this site up back from the dead.  I&#8217;ve been busy with various projects and running my own <a
href="http://www.transactplus.com/" target="_blank">CRM</a> company that I haven&#8217;t truly had time to focus on new technology.  This new site awakening is an effort to remedy that.</p> ]]></content:encoded> <wfw:commentRss>http://www.jingyen.com/resurrection/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: jingyen.com @ 2012-02-22 21:16:12 -->
