POST data from PHP and GET data in java servlet -


is there method can retrieve data (eg, username , password) php java servlet? thanks

create post request in php:

use curl:

$ch = curl_init('http://www.example.com:8080/my-servlet/'); $data = '...' # data want send  curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $data); curl_setopt($curl, curlopt_returntransfer, true);  $response = curl_exec($ch); curl_close($ch); 

a better, more concise approach, using pecl_http:

$response = http_post_data('http://www.example.com:8080/my-servlet/', $data); 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -