Pergunta

I used to have the following call working just fine on a Rails app running Ruby 1.8.7:

HTTParty.post("my uri", :body => "some body", :headers => { "Content-type" => "text/xml"})

When I run the same line on Ruby 1.9.2 I'm getting a MultiXml::ParseError with this message:

"xmlns: URI xyz is not absolute"

The call to my uri works just fine when I use curl, and I get back the expected response, which looks something like this:

<client login="foo" numsessions="1" xmlns="xyz"/>

Any Insight?

Foi útil?

Solução

After much struggle, I gave up on HTTParty for this. I tried Patron, which worked local, but didn't on Heroku, and I finally settled on RestClient, which worked great. https://github.com/archiloque/rest-client

Outras dicas

That's because curl doesn't try to parse the xmlns. You could either try making sure you use the same version of httparty with 1.9.2 as you use with 1.8.7 or asking the people in charge of that uri to make the xmlns valid

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top