代码
public static void main(String[] args) {
String access_token = "2.00vsiK1GXWDpMCd3a0885e3e";
String statuses = "哎,悲哀,钱包丢了又回,回了又丢,TM的玩我啊";
String content="";
try {
content=URLEncoder.encode(statuses, "gbk");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Timeline tm = new Timeline();
tm.client.setToken(access_token);
try {
Status status = tm.UpdateStatus(content);
Log.logInfo(status.toString());
} catch (WeiboException e) {
e.printStackTrace();
} }
//分享一条微博
public Status UpdateStatus(String status) throws WeiboException {
return new Status(client.post(WeiboConfig.getValue("baseURL")+ "statuses/share.json",
new PostParameter[] { new PostParameter("status", status) }));
}
出错
com.developingteam.server.action.alibaba.marketing.weibo.sina.weibo4j.model.WeiboException: 400:The request was invalid. An accompanying error message will explain why. This is the status code will be returned during rate limiting.
error:text not find domain! error_code:10017/2/statuses/share.json
参数非法 但我格式应该是正确的呀