I have the following code
String openGraphUri = "https://graph.facebook.com/";
String accessToken = "gerkjh43kj5h43kjh34k";
ClientResource clientResource = new ClientResource(openGraphUri
+
"me/feed" + "?access_token=" + accessToken);
Form form = new Form();
form.add("message", "test message");
Representation resp = clientResource.post(form);
When I run it I get the below exception. You can try the code without any
change because the access token provided above is invalid and the code will
throw the same exception (Bad Request 400)
java.io.IOException: Parameter or extension has no name. Please check your
value
at
org.restlet.engine.http.header.HeaderReader.readParameter(HeaderReader.java:425)
at
org.restlet.engine.http.header.ChallengeRequestReader.readValue(ChallengeRequestReader.java:128)
at
org.restlet.engine.http.header.ChallengeRequestReader.readValue(ChallengeRequestReader.java:46)
at
org.restlet.engine.http.header.HeaderReader.addValues(HeaderReader.java:243)
at
org.restlet.engine.http.header.HeaderReader.readValues(HeaderReader.java:605)
at
org.restlet.engine.security.AuthenticatorUtils.parseRequest(AuthenticatorUtils.java:378)
at
org.restlet.engine.http.header.HeaderUtils.copyResponseTransportHeaders(HeaderUtils.java:814)
at
org.restlet.engine.http.connector.ClientConnection.copyResponseTransportHeaders(ClientConnection.java:152)
at
org.restlet.engine.http.connector.ClientConnection.readMessage(ClientConnection.java:269)
at
org.restlet.engine.http.connector.Connection.readMessages(Connection.java:673)
at
org.restlet.engine.http.connector.Controller$2.run(Controller.java:95)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Exception in thread "main" Bad Request (400) - Bad Request
at org.restlet.resource.ClientResource.handle(ClientResource.java:867)
at org.restlet.resource.ClientResource.post(ClientResource.java:1206)
at org.restlet.resource.ClientResource.post(ClientResource.java:1152)
at
com.zeedna.applications.social.facebook.resources.Test.main(Test.java:21)
Thank you
Mutaz
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/Bad-Request-400-Bad-Request-exception-Bug-tp7417695p7417695.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2942029