Sinantra, like access URL parameters such as "? Something = xyz" in the POST handler (this is not in the [] parameters)

We use a third-party web service that returns multi-page POSTS data (file). But it also passes an extra parameter through the url http://ourdomain.com/theposturl?extra=good

the 'filename' object with: filename and: tempfile for binary data are in the [] parameters

but how do we get good from url?

post /theposturl
  puts params.inspect    # this shows a hash with filename, 
                         # :filename and :tempfile as expected

  extra_param = ??????[:extra] # but what lets us 'read' the ?extra=good off the url

end
+3
source share
1 answer

You need to use the string as a hash key.

extra_param = params["extra"]
+10
source

Source: https://habr.com/ru/post/1792634/


All Articles