<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -17,6 +17,7 @@ module HTTParty
   end
   
   AllowedFormats = {:xml =&gt; 'text/xml', :json =&gt; 'application/json'}
+  SupportedHTTPMethods = [Net::HTTP::Get, Net::HTTP::Post, Net::HTTP::Put, Net::HTTP::Delete]
   
   module ClassMethods    
     #
@@ -66,22 +67,22 @@ module HTTParty
     
     # TODO: spec out this
     def get(path, options={})
-      send_request 'get', path, options
+      send_request Net::HTTP::Get, path, options
     end
 
     # TODO: spec out this    
     def post(path, options={})
-      send_request 'post', path, options
+      send_request Net::HTTP::Post, path, options
     end
 
     # TODO: spec out this    
     def put(path, options={})
-      send_request 'put', path, options
+      send_request Net::HTTP::Put, path, options
     end
 
     # TODO: spec out this    
     def delete(path, options={})
-      send_request 'delete', path, options
+      send_request Net::HTTP::Delete, path, options
     end
     
     private
@@ -99,12 +100,12 @@ module HTTParty
       #   headers     =&gt; hash of headers to send request with
       #   basic_auth  =&gt; :username and :password to use as basic http authentication (overrides @auth class instance variable)
       # Raises exception Net::XXX (http error code) if an http error occured
-      def send_request(method, path, options={}) #:nodoc:
+      def send_request(klass, path, options={}) #:nodoc:
         options = {:limit =&gt; 5}.merge(options)
         options[:limit] = 0 if options.delete(:no_follow)
         
         raise HTTParty::RedirectionTooDeep, 'HTTP redirects too deep' if options[:limit].to_i &lt;= 0
-        raise ArgumentError, 'only get, post, put and delete methods are supported' unless %w[get post put delete].include?(method.to_s)
+        raise ArgumentError, 'only get, post, put and delete methods are supported' unless SupportedHTTPMethods.include?(klass)
         raise ArgumentError, ':headers must be a hash' if options[:headers] &amp;&amp; !options[:headers].is_a?(Hash)
         raise ArgumentError, ':basic_auth must be a hash' if options[:basic_auth] &amp;&amp; !options[:basic_auth].is_a?(Hash)
         
@@ -117,7 +118,6 @@ module HTTParty
           existing_query + (options[:query].is_a?(Hash) ? default_params.merge(options[:query]).to_query : options[:query])
         end
         
-        klass          = Net::HTTP.const_get method.to_s.downcase.capitalize
         request        = klass.new(uri.request_uri)
         request.body   = options[:body].is_a?(Hash) ? options[:body].to_query : options[:body] unless options[:body].blank?
         basic_auth     = options.delete(:basic_auth) || @auth
@@ -131,7 +131,7 @@ module HTTParty
           parse_response(response.body)
         when Net::HTTPRedirection
           options[:limit] -= 1
-          send_request(method, response['location'], options)
+          send_request(klass, response['location'], options)
         else
           response.instance_eval { class &lt;&lt; self; attr_accessor :body_parsed; end }
           begin; response.body_parsed = parse_response(response.body); rescue; end
@@ -166,4 +166,4 @@ module HTTParty
         AllowedFormats.each { |k, v| return k if mimetype.include?(v) }
       end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/httparty.rb</filename>
    </modified>
    <modified>
      <diff>@@ -139,10 +139,10 @@ describe HTTParty do
 
       Foo.headers.clear # clear out bogus settings from other specs
       Foo.format :xml
-      Foo.send(:send_request, 'get', '/bar').should be_nil
+      Foo.get('/bar').should be_nil
 
       response.stub!(:body).and_return(&quot;&quot;)
-      Foo.send(:send_request, 'get', 'bar').should be_nil
+      Foo.get('bar').should be_nil
     end
 
     describe &quot;that respond with redirects&quot; do
@@ -186,7 +186,7 @@ describe HTTParty do
         http.stub!(:request).and_return(redirect)
 
         lambda do
-          Foo.send(:send_request, 'get', '/foo')
+          Foo.get('/foo')
         end.should raise_error(HTTParty::RedirectionTooDeep)
       end
 
@@ -218,4 +218,4 @@ describe HTTParty do
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/httparty_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ae864580edb85b4e47aebf14afeff81855f202c8</id>
    </parent>
  </parents>
  <author>
    <name>Rein Henrichs</name>
    <email>reinh@reinh.com</email>
  </author>
  <url>http://github.com/jnunemaker/httparty/commit/a2fd09256fb5b4558838c32b19f158024d065fb0</url>
  <id>a2fd09256fb5b4558838c32b19f158024d065fb0</id>
  <committed-date>2008-11-08T09:05:59-08:00</committed-date>
  <authored-date>2008-11-08T09:05:59-08:00</authored-date>
  <message>Replacing string parameters with Net::HTTP classes

- send_request now uses the Net::HTTP classes directly
  rather than using const_get to grab them from 'get', etc.</message>
  <tree>e2cc34a50dab1898d2f5d4d236d5badee7d01951</tree>
  <committer>
    <name>Rein Henrichs</name>
    <email>reinh@reinh.com</email>
  </committer>
</commit>
