<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>GeoBliki's Blog: Accessing SOS with Basic Authentication - Ruby</title>
    <link>http://wwww.geobliki.com/articles/2006/10/23/accessing-sos-with-basic-authentication-ruby</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Sensor Web Enabled (SWE) Data Node </description>
    <item>
      <title>Accessing SOS with Basic Authentication - Ruby</title>
      <description>&lt;p&gt;Basic authentication in Ruby example.&lt;/p&gt;

&lt;p&gt;This is using Ruby 1.8.4 which may be installed:  &lt;/p&gt;

&lt;p&gt;Windows: http://rubyforge.org/frs/?group_id=167&lt;/p&gt;

&lt;p&gt;OSX: http://hivelogic.com/articles/2005/12/01/ruby&lt;em&gt;rails&lt;/em&gt;lighttpd&lt;em&gt;mysql&lt;/em&gt;tiger&lt;/p&gt;

&lt;p&gt;Example XML to pass to the SOS is found http://eo1.geobliki.com/sosdemo &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;post_it(xml)


 def post_it( xml, user = "bob", pass = "test")
    url = URI.parse('http://eo1.geobliki.com/sos')
    req = Net::HTTP::Post.new(url.path)
    req.basic_auth(user, pass)
    req['Content-Type'] = "text/xml"
    req.body = xml
    @response = Net::HTTP.start(url.host, url.port){|http|
      http.request(req)
    }
    puts @response.body     

  end
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Mon, 23 Oct 2006 13:26:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:1718c151-e5f0-4ed9-8e45-02b8f929f8c3</guid>
      <author>Linda Derezinski</author>
      <link>http://wwww.geobliki.com/articles/2006/10/23/accessing-sos-with-basic-authentication-ruby</link>
      <category>ruby</category>
      <category>authentication</category>
      <category>basic</category>
    </item>
  </channel>
</rss>
