Skip to content Skip to sidebar Skip to footer

Http 500 Internal Server Error In Android

Android code class BirthdayTask extends AsyncTask{ @Override protected String doInBackground(String... uri) { HttpClient

Solution 1:

Whenever an HTTP code starts with a 5 (5xx), it means something got wrong on the server. It is not about your code here, on the android client side, but in the server side implementation.

This is webservice I am calling from broweser its woriking fine ....But when I am calling from android then 500 internal server error

This may mean the the request payload that you are sending from your android app, must be different to that when you do it from your browser. Please print your request payload and double-check everything. Additionally, it might help you also give the request headers a look.

Solution 2:

It is hard to give an answer, but i think the session is null when you call the WS using Android. While if you call the WS using a browser the session could be mantained using cookie or sessionId i dont find any line of code that handles cookies or sessionId in some way. IMO you shouldnt rely on session information. Hope it helps you.

Solution 3:

I recommend using retrofit instead of AsyncTask. It will solve the problem with a cookie.

Post a Comment for "Http 500 Internal Server Error In Android"