There error I get is:
HTTPVersionNotSupported # 505
On Mar 24, 8:48 am, "tashfeen.ekram"
<tashfeen.ek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I am trying to make a GET request to the below listed url which should
> return an XML. When I put the compete url in my browser, I get the
> intended XML.
>
>
http://axml.travelnow.com/external/xmlinterface.jsp?cid=1&resType=air...<AirSessionRequest
>
method="getAirAvailability"><AirAvailabilityQuery><originCityCode>MCI</
> originCityCode><destinationCityCode>ATL</
> destinationCityCode><departureDateTime>11/19/2005 11:00 AM</
> departureDateTime><returnDateTime>11/21/2005 10:00 AM</
>
returnDateTime><fareClass>Y</fareClass><tripType>R</
> tripType><Passengers>
<adultPassengers>1</adultPassengers></
> Passengers></AirAvailabilityQuery></AirSessionRequest>
>
> However, when I try to make a request with Net:HTTP I get a
> HTTPNotValidError.
>
> Here is what I have:
>
> url = URI.parse(''http://axml.travelnow.com'')
> req = Net::HTTP::Get.new("/external/xmlinterface.jsp?
> cid=1&resType=air&intfc=ws&xml=<AirSessionRequest
>
method="getAirAvailability"><AirAvailabilityQuery><originCityCode>MCI</
> originCityCode><destinationCityCode>ATL</
> destinationCityCode><departureDateTime>11/19/2005 11:00 AM</
> departureDateTime><returnDateTime>11/21/2005 10:00 AM</
>
returnDateTime><fareClass>Y</fareClass><tripType>R</
> tripType><Passengers>
<adultPassengers>1</adultPassengers></
> Passengers></AirAvailabilityQuery></AirSessionRequest")
> res = Net::HTTP.start(url.host, url.port) {|http|
> http.request(req)
> }
> puts res
> puts res.body
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.