How to make an async POST request in Ruby using RestClient
-
15-11-2019 - |
Question
Can we make an asynchronous POST request to a resource in Ruby using the RestClient library ( https://github.com/archiloque/rest-client )?
Solution
If by "asyncronous POST request" you mean "fire-and-forget" kind of request, then you can execute it on another thread.
Thread.new do
# do your request here
end
Note, however, that not all Ruby implementations use real concurrent threads. See this topic for more details.
OTHER TIPS
Using 'send_later' of Resque should be a better option.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow