About the value transfer mechanism between java and php using json! I have encountered such a problem:
First, I can implement the following steps: The java program sends a request to my php page. I use json_encode to return the data to the java program.
Now, I don't know how to implement the following steps. I don't know how to implement the mechanism in it ?!!!
That is, the java program sends a json data packet to my php page. what function should I use in php or use a custom method to obtain the json data packet sent by the java program? Can I use the request line?
As long as I know how to obtain it, I know how to interpret its json data packets ~~
Master ~~ Thank you ~
I don't have a lot of small scores, so I can try to give it so much ~~
Reply to discussion (solution)
In java, you can't directly post and get the past, right? What functions are used?
Ajax.
In java, you can't directly post and get the past, right? What functions are used?
On the java program side, I post the php page to me. I have used $ _ POST for receiving and no data output. as for $ _ GET, it is useless, because it is not passed through the url. So I don't know how to get the data from the java program.
Ajax.
Can you give an example?
If you use java post, php does not have any data, that is, no POST is successful. check the data to see what went wrong.
Ajax also uses post or get.
I have encountered such a problem:
First, I can implement the following steps: The java program sends a request to my php page. I use json_encode to return the data to the java program.
Now, I don't know how to implement the following steps. I don't know how to implement the mechanism in it ?!!!
That is, the java program sends a json data packet to my php page. what function should I use in php or use a custom method to obtain the json data packet sent by the java program? Use re ......
Json_encode and json_decode of PHP cannot interwork with JAVA. we recommend that you use strings for transmission so that PHP and JAVA can handle them correctly.
File_get_contents ("php: // input") pushes data in java. in this way, the php client can get the data.