• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sending some values from PHP to Java using HttpClient  RSS feed

 
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


 
Rancher
Posts: 42975
76
  • 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.
 
Something must be done about this. Let's start by reading this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!