Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Sending some values from PHP to Java using HttpClient Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sending some values from PHP to Java using HttpClient" Watch "Sending some values from PHP to Java using HttpClient" New topic
Author

Sending some values from PHP to Java using HttpClient

srinivas srini
Greenhorn

Joined: Feb 03, 2004
Posts: 23
Hi ,
I want to return some values from the PHP files to the invoking Java class, and I am invoking the PHP from java like this...



I want to how to set values in the response and know how to capture those values at the java side, a code snippet would be of great help.
Also let me know what are the options i have for passing values from php to java.
I have tried at PHP code by setting to body of httpresponse but it did not worked.

HttpResponse::setBody("somekey", "somevalue");

Thanks in advance


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
Check out into the JSON format. It's probably the most common way to transfer data over HTTP these days, and there are libraries available for just about any language certainly for Java and PHP there are, so both sides of your call should be covered.


Ping & DNS - my free Android networking tools app
 
Don't get me started about those stupid light bulbs.
 
subject: Sending some values from PHP to Java using HttpClient
 
Similar Threads
SSLHandshake Error while connection to remote server
get parameter from ApacheHttpClient in servlet
how to submit and receive the responce of XML through java
Postmethod
Using PostMethod to post from a servlet without capturing the response body