5
When an Android app sends a post to a web server (like a PHP page), this page receives an HTTP-Useragent type "Apache-Httpclient/UNAVAILABLE (Java 1.4)".
I wonder if you have a solution to change this value on the Android side? The goal would be to prevent another app trying to connect on this page. So, with a specific value, it would be possible for PHP to test who calls it.
If the goal is to prevent other accesses that are not made by the App, I believe you can send an extra header parameter without changing the
User-Agent
. For this, it depends on which class you are using to make the connection.– Paulo Rodrigues
You must be using the Httpclient from Apache. But that gives, until you can change the Useragent, as demonstrated here in the documentation. But for the purposes that you want to use I believe that is not the best option, because from what I understand you want to do some kind of "Authentication" validating this field on the server, I will not tell you anything, but if you search.
– Fernando Leal