rest - Response string is blank in loopj for Android -
Here is the code that I have used loopj for async Http requests.
AsyncHttpClient LoopjClient = New AsyncHttpClient (); Persistent cookiestor lupazkiyicaster = new persistent cookie store (this); LoopjClient.setCookieStore (loopjCookieStore); Request Perm LoopJam = New Request (); LoopjParams.put ("username", user name); LoopjParams.put ("Email", Email ID); LoopjParams.put ("password", password); Log D. (Tag, "RRRRRRL"); LoopjClient.post ("http://www.example.com/", LoopJarrum, new non-HTTPHPPRESpensHandler () {@OverWide Public Voed On Seewes (Int Kashmir, String Response) {Super. Onsuits (K, Response); Log D. (Tag, "RRRRRR" + response);}}); and my server response strings are just following HTML tags
{"authentication": {"success": wrong, "USERNAME": " Unregistered "," USERID ": 0}," ALERTBOX ": {" Show ": True," Message ":" Message: Username or Email ID is already registered. Please choose another. "}} but onSuccess () does not print the above string in loopj . You can ask to get the string or
edit instead of 'example' (my site) If I replace it with 'facebook', then only 200 string code & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; The following string gets in the form of a response since the result of authentication failed, I am thinking that your server does not have a return status code or not. 200. You can override the failure method to deal with this situation. Override public null on @follow (throbable e) {log d. (Tag, etstring ()); }
edit
Another guess is, did you add the following line to your manifestifest.xml? & lt; Usage-permission Android: name = "android.permission.INTERNET" /> Edit again
I saw your edit, and it seems like you have mentioned in the commentary @ Shailendra-Rajwat Logcat has just printed the first line instead of trying toast: Override public null at @Success (Inter-K, String Response) {Toast. Make text (getBaseContext), feedback, 1). Show (); } I got to configure your logcat, and maybe you can give it a try (I have 5000 FYIs)
Comments
Post a Comment