Rest call fails from android but works from browser


I have set up a public custom script service. I followed the tutorial from .

If I use and simulate a post request to which is my localhost everything works. I get back a script error response :
“context”: null,
“message”: “Undefined index: loginType”,
“code”: 500,

The same call(post, with header containing X-DreamFactory-Api-Key which I checked 20 times made from android (Everything else on the app that needs a session token from android works ok) fails :

POST /api/v2/auth_confirm HTTP/1.1

Accept application/json
X-DreamFactory-Api-Key 1dcc1606f2cd2b84c6a5132be3d3e74cffcce0603157f92c41xxx
Content-Type application/json
Content-Length 250
User-Agent Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 5 - 5.1.0 - API 22 - 1080x1920 Build/LMY47D)
Connection Keep-Alive
Accept-Encoding gzip

“error”: {
“context”: null,
“message”: “Invalid token: Wrong number of segments”,
“code”: 401,


Well there seems to be a problem in the following param :

The browser rest call sends in the header : Content-type : text/html
The android sends : Content-type : application/json; charset=UTF-8

The public rest service doesn’t work with content-type : application/json but the rest endpoints like user/session work and the ones that need X-DreamFactory-Session-Token work with this content-type

Can someone confirm or explain please ?

@aislam @toddappleton

Thank you.