2012-02-29 33 views

回答

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); 
} 
+0

評論板網址末尾的'/'是關鍵 – 2012-03-01 17:50:46