1

我找不到任何使用 REST API 2.0(适用于 rb 1.6.3 版本)创建新审核请求的文档。任何指针表示赞赏。

4

1 回答 1

1

没关系。我通过 postreview.py 代码弄清楚了。这是我编写的 java 等效代码。

private void createRequest(HttpClient httpClient) throws UnsupportedEncodingException, IOException {
    HttpPost post = new HttpPost("http://myreviewboardserver/api/review-requests/");
    List<NameValuePair> data = new ArrayList<NameValuePair>();
    data.add(new BasicNameValuePair("repository", "https://mysvnrepositorypath"));
    post.setEntity(new UrlEncodedFormEntity(data));
    HttpResponse response = httpClient.execute(post);
    HttpEntity entity = response.getEntity();

    entity.writeTo(System.out);
    EntityUtils.consume(entity);
}
于 2012-03-01T17:49:47.380 回答