Hi, I'm writing my first web services for elgg. I'm facing an issue.
Calling the webservice from a browser displays a correctly formated json response while calling the webservice from an ajax call (with jquery) sends an empty string...causing failure in the ajax call.
web servire URL : http://dev.mgogolf.com/services/api/rest/json/?method=user.authentication&username=test&password=test
test from jsfiddle : http://jsfiddle.net/53Lf3/10/
So I think it is something happening on server side... but I cannot figure it out.
Could you help me please?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Cash@costelloc

Cash - 0 likes
- mickooo@malbert

mickooo - 0 likes
- Cash@costelloc

Cash - 0 likes
- hit localhost and it succeeded
- hit the same endpoint on the community site and it failed
- mickooo@malbert

mickooo - 0 likes
- Cash@costelloc

Cash - 0 likes
You must log in to post replies.My guess is that you are logged in using the browser but not with the ajax call. Does this web service method require access to data that only a logged in user can see?
Hi Cash,
I've checked that I wasn't logged in before doing the call from the browser. The webservice accepts anonym login...as it is to check if the user exists and can logged in.
It is like if there is a check in the header that forbids call from another sources than browsers.
I just grabbed your test code, modified it to call system.api.list, and tried running it on my localhost in 2 ways:
So have you any clue on how I can handle this problem ?
Well, that doesn't establish were the problem is. I don't have time right now to determine why that jQuery code is failing on the call to the community site (and it's not an empty string for it - it is calling the error callback).