Issue with rest api, HTTP get all passed, PUT/POST failed

249 views
Skip to first unread message

Yan Bi

unread,
Jan 24, 2016, 8:12:26 PM1/24/16
to Repo and Gerrit Discussion
I just use apache http client to access gerrit via rest api. All the http method with get, e.g. query changes, list projects work fine. But the methods with put/post failed with error "Status:HTTP/1.1 403 Forbidden". Any idea? Thanks!

David Pursehouse

unread,
Jan 24, 2016, 8:16:28 PM1/24/16
to Yan Bi, Repo and Gerrit Discussion
On Mon, Jan 25, 2016 at 10:12 AM Yan Bi <biya...@gmail.com> wrote:
I just use apache http client to access gerrit via rest api. All the http method with get, e.g. query changes, list projects work fine. But the methods with put/post failed with error "Status:HTTP/1.1 403 Forbidden". Any idea? Thanks!

Make sure you are sending authenticated requests by adding /a/ in the URL.  Also make sure you are authenticating with the HTTP username and password, not your SSH password.

Refer to the documentation here:


Message has been deleted

Yan

unread,
Jan 25, 2016, 4:07:26 PM1/25/16
to Repo and Gerrit Discussion
it works now

荆晶

unread,
May 17, 2019, 3:24:05 AM5/17/19
to Repo and Gerrit Discussion
i need to modify gerrit usename  via rest api,when i use "http://172.19.219.177:85/a/accounts/1000001/jingjing",the response is "401 Unauthorized"

2.jpg

1.jpg


 
在 2016年1月26日星期二 UTC+8上午5:07:26,Yan写道:
it works now
Reply all
Reply to author
Forward
0 new messages