huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

API can potentially send POST requests without Content-Type header #241

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, 

The problem is that postRequest method from ExtensibleClient.java relies 
on a buggy HttpURLConnection which by default adds a Content-Type header 
with value "application/x-www-form-urlencoded" whereas it shouldn't:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6369510

Because my platform is patched, it sends POST requests without Content-
Type header, which are rejected by facebook. 
As a consequence  I'm unable to log in into facebook using auth_createToken
().

I think that this issue could be solved by adding the header in 
ExtensibleClient.java line 628:

conn.setRequestProperty("Content-type", "application/x-www-form-
urlencoded");

Regards,

Christophe

Original issue reported on code.google.com by christop...@gmail.com on 14 Sep 2009 at 2:34

GoogleCodeExporter commented 8 years ago
ok, we'll try it.

Original comment by fern...@gmail.com on 1 Nov 2009 at 1:18