Skip to content

Drupal call webservices

November 20, 2011

1) Method Post:

$data = array (
‘login_name’ => ‘admin’,
‘login_password’ => ‘123456’,
‘software’ => ‘software_testing’,
‘software_version’ => ‘1.0.0’,

);

$response = drupal_http_request(‘http://xyz_url’, array(‘headers’=>array(‘Content-Type’ => ‘application/x-www-form-urlencoded’),
‘method’=>’POST’, ‘data’ => http_build_query($data, ”, ‘&’)));

if (!isset($response->error)) {
$data = $response->data;
}

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: