简体   繁体   中英

Hide json data in from the browser which are getting in android app

I am pulling JSON values from the browser in my android app, but when I browse php files in the browser, the JSON data is displayed. My question is this: How can I hide the JSON data from the browser for security reasons?

hi you can do one thing

when you want to fetch data from php , php must fetch data if the request sent by POST method , and contain parameter to check , for more explain

in php file

<?php

if(isset($_POST['checked'] && $_POST['checked']=="password")
{

echo json_encode($json);

}

?>

now from android , when you send http request select post method , and add parameter checked="password"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM