• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending some values from PHP to Java using HttpClient

 
srinivas srini
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic