[Myexperiment-discuss] Handle GET/POST and send on
From:
Linde, A.E.
Subject:
[Myexperiment-discuss] Handle GET/POST and send on
Date:
Thu, 30 Oct 2008 12:02:59 +0000
Hi, my proxy controller handles GETs ok but the majority of calls to it will be POSTs, so at the moment I have:
def proxy
query = CGIMethods.parse_query_parameters(request.query_string)
uri = URI.parse(query['uri'])
response = Net::HTTP.start(uri.host, uri.port) { |http|
http.get(uri.path + (uri.query ? "?"+uri.query : ""))
}
send_data(response.body, :type => response['content-type'],
:status => "#{response.code} #{response.message}")
end
Can someone tell me what I need to: a) detect whether call is POST or GET; b) if post, how to get parameter values and compose a new POST to a url in one of the parameter values?
Many thanks,
Tony.
(I know I should work this out myself but I’m desperately trying to get a demo together for a meeting next week.)
--
Tony Linde
Project Manager
Department of Physics & Astronomy
University of Leicester
[Prev in Thread]
Current Thread
[Next in Thread]
[Myexperiment-discuss] Handle GET/POST and send on,
Linde, A.E.<=