【问题标题】:Specifying the offset and limit in a Redmine REST API request with Ruby使用 Ruby 在 Redmine REST API 请求中指定偏移量和限制
【发布时间】:2012-05-08 16:48:19
【问题描述】:

我正在使用 Redmine 的 Ruby REST API(此处为:http://www.redmine.org/projects/redmine/wiki/Rest_api_with_ruby)。我需要能够一次解决 100 个问题。

我知道方法“api_offset_and_limit”正在寻找一个 options[:offset] 和一个 options[:limit]。

执行此操作时如何传递这些选项?我尝试将它们作为 GET 选项放在 URL 中,但它们在另一端没有通过。以下是我所期望的前 25 个问题。

class Issue < ActiveResource::Base
  self.site = 'http://redmine.server/'
  self.user = 'foo'
  self.password = 'bar'
end

# Retrieving issues
issues = Issue.find(:all)

【问题讨论】:

    标签: ruby api redmine


    【解决方案1】:

    我对 API 不熟悉,但按照您描述的方式,应该可以:

    issues = Issue.find(:all, :params => {:offset => 0, :limit => 100})
    

    【讨论】:

      猜你喜欢
      • 2011-08-05
      • 2014-07-25
      • 1970-01-01
      • 2015-06-13
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 2017-03-27
      相关资源
      最近更新 更多