Skip to content Skip to sidebar Skip to footer

Post Request Does Not Reach The Server

I'm trying to send data from an Android smartphone via a POST request to a REST web service. There is no error on client side, but on the server side is no code executed if I have

Solution 1:

There's no error because you are catching the errors and doing nothing with them.

Try adding the following into the catch blocks and you should see what's happening in your LogCat output. Remember to the import the Log class

Log.w("com.name.pkg", e);

where "com.name.pkg" is just a tag so help you filter on. usually the name of the program.

Alternatively, quite commonly in use is to send a toast with Toast.makeText(...).show(); with e.getMessage() but I don't like doing that, so I don't recommend it. You would be better to pass a string back to the calling function and allow that to do the toast.

Post a Comment for "Post Request Does Not Reach The Server"