New module needs to return very short message (e.g. 'OK') instead of full Drupal Page

Cayenne - November 7, 2009 - 01:08

I am sure I am overlooking something obvious or simple, but in my quest to build an external authentication server on Drupal, I have a need to provide a very simple http response to an HTTP GET request.

I assume it is possible. Can I just change something in the module declarations, or is it more complex?

$items['member/verify'] = array(
    'title' => 'Valids',
    'page callback' => 'my_id_verify_me',
    'access arguments' => array('access content')
  );

Thanks!

print instead of returning a

nevets - November 7, 2009 - 02:26

print instead of returning a value.

That seems to do it.

Cayenne - November 7, 2009 - 03:00

Is that ordinary behavior, or am I exploiting an undocumented feature?

Thanks!

---------------------

"He's said to be outspoken, but nobody's actually seen anyone do it"

It may be both :)

nevets - November 7, 2009 - 03:51

It may be both :) Seriously it is how it works (javascript that uses callback reply on it).

OK! Good enough for me!

Cayenne - November 7, 2009 - 04:23

Thanks!

---------------------

"He's said to be outspoken, but nobody's actually seen anyone do it"
 
 

Drupal is a registered trademark of Dries Buytaert.