<?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>Arash Payan &#124; Blog &#187; python</title>
	<atom:link href="http://arashpayan.com/blog/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://arashpayan.com/blog</link>
	<description>(Place witty tagline here)</description>
	<lastBuildDate>Mon, 02 Apr 2012 03:02:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get the browser&#8217;s user agent with mod_python</title>
		<link>http://arashpayan.com/blog/2009/08/07/get-the-browsers-user-agent-with-mod_python/</link>
		<comments>http://arashpayan.com/blog/2009/08/07/get-the-browsers-user-agent-with-mod_python/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 20:54:22 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[mod_python]]></category>
		<category><![CDATA[psp]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[user-agent]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=145</guid>
		<description><![CDATA[I recently discovered the beauty of mod_python and python server pages (psp), and I&#8217;ve been slowly replacing the php code on my server as I make changes. One thing that took me awhile to figure out was how to get the user-agent of the requesting client. In the hopes of helping others in the same [...]]]></description>
			<content:encoded><![CDATA[<p>I recently discovered the beauty of <a href="http://onlamp.com/pub/a/python/2003/10/02/mod_python.html">mod_python</a> and <a href="http://onlamp.com/pub/a/python/2004/02/26/python_server_pages.html">python server pages (psp)</a>, and I&#8217;ve been slowly replacing the php code on my server as I make changes. One thing that took me awhile to figure out was how to get the user-agent of the requesting client. In the hopes of helping others in the same boat, here&#8217;s the line of code:</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">&lt;%= req.headers_in[<span style="color:#760f15;">'User-Agent'</span>] &nbsp;%&gt;</div>
<p><br/></p>
<p>As you can see all the request&#8217;s header information is in the <code>req.header_in</code> dictionary.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Farashpayan.com%2Fblog%2F2009%2F08%2F07%2Fget-the-browsers-user-agent-with-mod_python%2F&amp;title=Get%20the%20browser%E2%80%99s%20user%20agent%20with%20mod_python" id="wpa2a_2"><img src="http://arashpayan.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2009/08/07/get-the-browsers-user-agent-with-mod_python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

