Specifying HTTP method in action methods

Events happening in the community are now at Drupal community events on www.drupal.org.
fulat2k's picture

Hi folks,

I've defined an action method which is exposed as a web service. However, all actions are called via the HTTP POST method.

Is there a way to explicitly state which HTTP method a particular action supports?

As an example, here's what I have defined:

        'validate' => array(
          'help' => 'Validates bonus code',
          'callback' => 'gs_bonus_validate_code',
          'access arguments' => array('access content'),
          'args' => array(
            array(
              'name' => 'code',
              'type' => 'string',
              'description' => 'Bonus code to be validated',
              'optional' => FALSE,
              'source' => array('path' => 1),
            ),
          ),

Here's what I'd like to be able to do:

        'validate' => array(
          'help' => 'Validates bonus code',
          'http method' => 'GET',
          'callback' => 'gs_bonus_validate_code',
          'access arguments' => array('access content'),
          'args' => array(
            array(
              'name' => 'code',
              'type' => 'string',
              'description' => 'Bonus code to be validated',
              'optional' => FALSE,
              'source' => array('path' => 1),
            ),
          ),

Thanks!

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: