[英]401 unauthorized urban airship error android
My code is: 我的代码是:
String encodedData = Base64.encodeBytes("YxxxxxxxxxxxxxxxA".getBytes());
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT_MILLISEC);
HttpConnectionParams.setSoTimeout(httpParams, TIMEOUT_MILLISEC);
HttpClient client = new DefaultHttpClient(httpParams);
HttpPost request = new HttpPost("https://go.urbanairship.com/api/airmail/send/broadcast/");
//request.setHeader(header)
request.addHeader("Authorization", "Basic " + encodedData)
Am using application master secret as per the document suggested here: 正在根据此处建议的文档使用应用程序主密码:
http://urbanairship.com/docs/richpush.html?highlight=broadcast http://urbanairship.com/docs/richpush.html?highlight=broadcast
but am getting 401 unauthorized error. 但收到401未经授权的错误。
How to resolve this? 如何解决呢?
Thanks 谢谢
The 401 error means you aren't properly authenticated. 401错误表示您未正确通过身份验证。 See this: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error
看到这个: http : //en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error
Are you sure you are providing your credentials properly? 您确定要正确提供凭据吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.