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
精彩评论