开发者

An HTTP POST, authenticated with the key Android

开发者 https://www.devze.com 2023-04-12 09:38 出处:网络
I had t开发者_C百科o doHTTP POST, authenticated with the key. I had the key with me and also url.

I had t开发者_C百科o do HTTP POST, authenticated with the key. I had the key with me and also url.

But am getting 400 response code i.e, bad request error.

My code is:

Authenticator.setDefault(new Authenticator() {
                    protected PasswordAuthentication getPasswordAuthentication() {
                       return new PasswordAuthentication("sixxxxxxxx","xxxxxxxxxTGh7fYbA:xxxxxxoRtGnOIb_vno1wQ".toCharArray());
                       }
                });

I found this is for username and password. But i want to authenticate with specific key only

How to do this?

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号