Topic: bad uri

http://SERVERNAME/ShippingAPITest.dll?API=CityStateLookup&XML=<CityStateLookupRequest%20USERID="xxxxxxx"><ZipCode ID= "0"><Zip5>90210</Zip5></ZipCode></CityStateLookupRequest>

whats wrong with this uri?

"They say, Evil prevails when good men do nothing. What they should have said was: Evil Prevails."

http://www.vrazzle.com

Re: bad uri

Why are you placing XML in the URL? Maybe you want a  POST request instead?

Railscasts - Free Ruby on Rails Screencasts

Re: bad uri

that may be ok but I'm not sure how it will work.

I copied this out of the usps api guide here. http://www.usps.com/webtools/htm/Addres … c131231418

If you put that url/uri in the address bar it returns the correct info.

I only have 2 months experience with rails and just a hour a day or so and very little experience with XML so I am limited to whats in tutorials and copy pasting now.

My previous post explains the problem in detail. I was trying to hack http://blog.thembid.com/index.php/2007/ … -on-rails/ into working though.

"They say, Evil prevails when good men do nothing. What they should have said was: Evil Prevails."

http://www.vrazzle.com

Re: bad uri

Try Net HTTP:

uri = URI.parse('http://SERVERNAME/ShippingAPITest.dll')
response = Net::HTTP.post_form(uri, 'API'=>'CityStateLookup', 'XML'=>'<...>')
puts response.body

Experiment with that in script/console. In order to parse the XML response you can use Hpricot.

Railscasts - Free Ruby on Rails Screencasts