0

I want to simulate opening a url (ie www.website.com/page.php?data=something), but without actually opening a browser. I don't care if there is a response, so I don't need to handle that. Is there a simple way to do this?

EDIT: Alright, so I have made some progress, but nothing actually working. So far I have an AsyncTask to run this:

{
URL url = new URL("http://example.com/folder/file.php?PAYLOAD=stringOfText");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.connect();
}

but nothing happens on the server side. For comparison, if I go to a browser and type the url in (http://example.com/folder/file.php?PAYLOAD=stringOfText), it responds as intended (that php generates another html file).

I'm not sure how to trouble shoot this at this point. I didn't use a lot of other code in httpUrlConnection because I wasn't using any return information.

2
  • yes, take a look here. Commented Aug 1, 2020 at 19:45
  • Alright, so I have made some progress, but nothing actually working. Commented Aug 1, 2020 at 23:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.