File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 41839
    
  63
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending some values from PHP to Java using HttpClient