gostaria de saber se alguem sabe erro…
quando tento postar está dando cliente error 302
if(type == POST_NEW_TOPIC_ABDERA){
Abdera abdera = new Abdera(); //?????
Factory factory = abdera.getFactory();
Entry entry = factory.newEntry();
entry.setTitle(title);
entry.setContentAsHtml(comment);
Category cat = factory.newCategory();
cat.setScheme("http://www.ibm.com/xmlns/prod/sn/type");
cat.setTerm("forum-topic");
entry.addCategory(cat);
return postAbdera(url, abdera, entry);
}
private static boolean postAbdera(String url, Abdera abdera, Entry entry)
throws URISyntaxException {
if (debug) {
Writer writer = abdera.getWriterFactory().getWriter(“prettyxml”);
try {
writer.writeTo(entry, System.out);
// return false;
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
AbderaClient abderaClient = new AbderaClient(abdera);
UsernamePasswordCredentials cred = null;
cred = getCreds();
abderaClient
.addCredentials("http://w3.forum.com", "realm", "basic", cred);
ClientResponse resp = abderaClient.post(url, entry);
System.out.println(resp.getType());
if (resp.getType() == ResponseType.SUCCESS) {
return true;
}
return false;