Hi,

"path" is the name of the file, not the path on the repository. The
repository path will come from the parent review request. You should
be encoding the file name and content together as "path".

Christian

--
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com



On Fri, Dec 10, 2010 at 5:11 PM, Dlite <victoria...@gmail.com> wrote:
> I am using Java and HttpClient to interface with the reviewboard web
> API.I have created a new review request draft using HTTP Post, but I
> am stuck with the diff part.
>
> From what I read (http://www.reviewboard.org/docs/manual/1.5/webapi/
> 2.0/resources/diff-list/), to create a new diff,  I need to do a HTTP
> Post with the following:
>
>  - url: http://myserver/api/review-requests/myrequest_id/diffs/
>
>  - set a path parameter
>
>  - send a multipart data with file name and file content
>
> So I tried with setting the path parameter to my svn repository:
>
>        List <NameValuePair> myPostParams = new
> ArrayList<NameValuePair>();
>        myPostParams.add(new BasicNameValuePair("path", "http://
> myserver/svn/trunk/"));
>        myHttpPost.setEntity(new
> UrlEncodedFormEntity(myPostParams));
>        HttpResponse myResponse = myHttpClient.execute(myHttpPost);
>
> I got this response:
>
> {"fields": {"path": ["This field is required"]}, "stat": "fail",
> "err": {"msg": "One or more fields had errors", "code": 105}}
>
> I couldn't figure out why my path paramenter didn't work. Did I miss
> something?
>
> Thanks for your help,
> Dlite
>
> --
> Want to help the Review Board project? Donate today at 
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to 
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/reviewboard?hl=en

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to