1

I want to get JSON response from my localhost where I have created a .php file which is returning the JSON response.. It works well except for localhost. My apache server and myPhp server are working well. Could somebody assist me?

8
  • 1
    Give some more information on your problem. Elaborate a little bit. Commented Nov 8, 2012 at 6:43
  • Ok. I have created a class in android which is accepting an URL and converting the JSON response returned by the URL to string.. Finally the class displays the string ( i.e JSON response). It works well for all URL's. But if I want to do the same for the URL i.e. .php file stored on localhost it gives me an error org.apache.http.conn.HttpHostConnectException: Connection to localhost refused.. I am confused for this. If you want I can put my code here Commented Nov 8, 2012 at 6:50
  • 1
    Which port you are trying to connect to ? Commented Nov 8, 2012 at 6:53
  • 1
    which OS are you using for development linux or windows ? Commented Nov 8, 2012 at 6:56
  • 1
    Ok the first thing I would suggest you is to check if the port is free and not used by any other process and i don't know how to do that on mac. The second is you try to change the localhost IP and Port on from which your program is interacting. Commented Nov 8, 2012 at 7:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.