From: Chris Roos Date: 2006-09-13T20:46:49+09:00 Subject: Using Net::HTTP to prod google adwords api Hi, I've been trying to use Net::HTTP with a SOAP (xml) document to query google adwords api. The reason for wanting to do this, is that I've stumbled across a problem with one of the methods when using adwords4r. I wanted to eliminate adwords4r and soap4r from the equation, hence trying to manipulate manually. I've copied the http headers from the output I see when using adwords4r (code is at bottom of message). Unfortunately, I get a http 302 response rather than the expected xml document. I'm wondering if there's anything obvious I'm missing? Chris -- code -- xml = %% MYEMAIL++GBP ruby api MYPASSWORD client_1+MYEMAIL MYEMAIL % require 'net/https' require 'uri' url = URI.parse('https://sandbox.google.com/api/adwords/v5/InfoService') http = Net::HTTP.new(url.host) http.set_debug_output(STDERR) request = Net::HTTP::Post.new(url.path) request['Content-Type'] = "text/xml; charset=utf-8" request['User-Agent'] = "Ruby client" request['Soapaction'] = "\"\"" request.body = xml http.start do |sess| sess.request(request) end