5

Can we make an asynchronous POST request to a resource in Ruby using the RestClient library ( https://github.com/archiloque/rest-client )?

Kalyan Maddu
  • 4,123
  • 2
  • 21
  • 26

2 Answers2

5

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.

Community
  • 1
  • 1
Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
0

Using 'send_later' of Resque should be a better option.

Yuanfei Zhu
  • 751
  • 5
  • 16