title: Can someone provide an example for how to post XML using HTTParty and Ruby on Rails?
body: <p>I need to post some xml to a webservice and I'm trying to use HTTParty. Can someone provide an example as to how I go about doing so?</p>
  
  <p>Here is the format of the XML I need to post:</p>
  
  <pre><code>&lt;Candidate xmlns="com.mysite/2010/10/10" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;FirstName&gt;&lt;/FirstName&gt;
  &lt;LastName&gt;&lt;/LastName&gt;
  &lt;Email&gt;&lt;/Email&gt;
  &lt;Gender&gt;&lt;/Gender&gt;
  &lt;/Candidate&gt;
  </code></pre>
  
  <p>Here is my class so far:</p>
  
  <pre><code>require 'httparty'
  
  
  class Webservice
    include HTTParty
    format :xml
    base_uri 'mysite.com'
    default_params :authorization =&gt; 'xxxxxxx'
  
    def self.add_candidate(first_name,last_name,email,gender)
      post('/test.xml', :body =&gt; "")    
    end  
  end
  </code></pre>
  
  <p>I'm not quite sure how to flesh out add_candidate.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks.</p>