Creazione di una nuova richiesta utilizzando l'API del cartellino
-
14-11-2019 - |
Domanda
Non riesco a trovare alcun documento per creare una nuova richiesta di revisione utilizzando API REST 2.0 (per la versione RB 1.6.3).Qualsiasi puntatore è apprezzato.
Soluzione
Non importa.L'ho capito passando attraverso il codice postreview.py.Ecco il codice equivalente Java che ho scritto.
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);
}
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow