how to use drupal_http_request

scarer - November 18, 2009 - 06:10

I'm currently developing a module that integrates dimdim and drupal 6.

I am having some problems formulating the http post request to create a new instance of a conference room.

I have sighted the API for drupal_http_request but since this is my frist time working with it am not sure if I am using it correctly. If anyone has any suggestions that'd be great. Here's the code I'm using to try to call it:

<?php
   
//issue http_request
   
$headers = array();
   
$dimdimserver = variable_get('dimdim_server_location', 1);
   
$dimdimport = variable_get('dimdim_server_location_port', 1);
   
$url = $dimdimserver . ':' . $dimdimport . '/portal/start.action?';
   
$headers['name'] = variable_get('dimdim_name', 1);
   
//$headers['email'] = variable_get('dimdim_email', 1);
   
$headers['password'] = variable_get('dimdim_password', 1);
   
$headers['returnurl'] = variable_get('dimdim_return_url', 1);
   
$headers['waitingarea'] = 'true';
   
$headers['startDate'] = $textdatestring;
   
$headers['meetingRecurrance'] = 'SINGLE_EVENT';
   
$headers['startHour'] = $hournozero;
   
$headers['startMinute'] = $minutesnozero;
   
$headers['timeAMPM'] = $ampm;
   
$headers['displayname'] = $node->host;
   
$headers['hours'] = $node->hours;
   
$headers['minutes'] = $node->minutes;
   
$headers['confname'] = $node->title;
   
$method = 'POST';
   
drupal_http_request($url, $headers, $method, 0, 3);
?>

Is there any way of testing what's actually being called in the full url with the headers tacked on the end? I tried to do a drupal_set_message but it didn't like it.

Another Dimdim module

matt.robinson1 - November 30, 2009 - 19:19

There's another dimdim module that has just been started here:
http://drupal.org/project/dimdim

I don't know if you know about it or are already collaborating on it, but I thought I'd let you know just in case.

You can see a working model

Jay Matwichuk - December 1, 2009 - 04:20

You can see a working model of drupal_http_request here: http://api.drupal.org/api/function/aggregator_refresh/6

 
 

Drupal is a registered trademark of Dries Buytaert.