I’ve got a bit of a problem interacting with the Overture (now YSM) API
and
I’m getting quite desperate for some help.
Basically I need to ‘post’ form data to a path containing get variables.
Unfortunately I can’t go into details about the API as its held under an
NDA
for some strange reason but please try and help from some of this
similar
code: #---------------------------------------------------------------------------------------------------
host = “secure.ysm1.com”
port = 443
now = Date::today()
yday = @now - 1
#The path with its get variables
path = “/index.jhtml?_ARGS=/index.jhtml”
resp, data = site.post(URI.parse
(@full_path),enc_text,{“Content-Type”=>“application/x-www-form-urlencoded”})
puts data # Should print XML formatted result but instead displays
route
of that server (the form HTML) as if no data was sent. #---------------------------------------------------------------------------------------------------
When I try using this class, rather than getting the XML reply I get the
HTML form located at the servers route. Which is as if the get
variables in
the path are being shaved off and its failing to post the data
correctly.
As you can see I also have to use the service over SSL and send a header
for
the content-type.
I’d be extremely greatful if anyone can shed any light because I’m going
mad. I’ve searched on Google and the groups to no avail so I’m all
ears.
resp, data = site.post
(path,enc_text,{“Content-Type”=>“application/x-www-form-urlencoded”})
puts data # Should print XML formatted result but instead displays
route
of that server (the form HTML) as if no data was sent. #---------------------------------------------------------------------------------------------------
Is the server under your control? Can you be certain that the server
isn’t just returning the form even though you’re posting data? My next
step would be to check what actually gets sent to the server using a
sniffer.
-tim
I’m going to try and use ‘http-access2’ as it mentions in the docs that
it
attempts to recreate Perls LWP library in Ruby. Its the LWP Overture
use in
their example Perl script.
I’ll keep you posted.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.