title: wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"
body: <p>I am getting a weird error when i make http request.</p>
  
  <p>The request code is like this;</p>
  
  <pre><code>purchase_xml = Transaction.yo_xml(api_username,api_password,@total, account, merchant_reference)
              uri = URI.parse(url)
              http = Net::HTTP.new(uri.host, uri.port)
              request = Net::HTTP::Post.new(uri.request_uri)
              request.body = purchase_xml
              response = http.request(request)
              result = Hash.from_xml(response.body)
  </code></pre>
  
  <p>Where the yo_xml looks like this;</p>
  
  <pre><code>def self.yo_xml(api_username, api_password,amount, account, transaction_id)
          xml = "&lt;?xml version=1.0 encoding=UTF-8?&gt;&lt;AutoCreate&gt;&lt;Request&gt;&lt;APIUsername&gt;#{api_username}&lt;/APIUsername&gt;
                  &lt;APIPassword&gt;#{api_password}&lt;/APIPassword&gt;&lt;Method&gt;acdepositfunds&lt;/Method&gt;&lt;Amount&gt;#{amount}&lt;/Amount&gt;
                  &lt;Account&gt;#{account}&lt;/Account&gt;&lt;Narrative&gt;Purchase of SMS&lt;/Narrative&gt;&lt;InternalReference&gt;#{transaction_id}&lt;/InternalReference&gt;
                  &lt;ExternalReference&gt;#{transaction_id}&lt;/ExternalReference&gt;&lt;ProviderReferenceText&gt;Thank you for using Skyline SMS&lt;/ProviderReferenceText&gt;
                  &lt;/Request&gt;&lt;/AutoCreate&gt;"
          return xml
      end
  </code></pre>
  
  <p>I am getting this error;</p>
  
  <pre><code>Net::HTTPBadResponse
  wrong status line: "&lt;!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"&gt;"
  </code></pre>
  
  <p>raised o this line</p>
  
  <pre><code>response = http.request(request)
  </code></pre>
  
  <p>Any help is appreciated.</p>