Skip to content
Advertisement

HttpURLConnection getting wrong response

Well, my php file includes simple code <?php echo "hello there" ?> Whenever I try read the file using HttpURLConnection.getInputStream(); it returns

JavaScript

All I want is to just read the raw file.. only “hello there” .. not anything else.. how to do that ?

Advertisement

Answer

The question is old and has been solved long ago. But here is something for people who is facing same issue: Found out that my HttpURLConnection and my php file both was correct. But the server was running a browser check before executing any file. Thus I was unable to reach the php file endpoint. I simply changed the hosting and it solved my issue.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement