function rules_http_client_rules_action_info in Rules HTTP Client 7
Implements hook_rules_action_info().
File
- ./
rules_http_client.rules.inc, line 11 - Rules module integration.
Code
function rules_http_client_rules_action_info() {
$items['request_url'] = array(
'label' => t('Request HTTP data'),
'base' => 'rules_http_client_request_url',
'group' => t('Data'),
'parameter' => array(
'url' => array(
'type' => 'uri',
'label' => 'URL',
),
'headers' => array(
'type' => 'text',
'label' => 'Headers',
'description' => 'Request headers to send as "name: value" pairs, one per line (e.g., Accept: text/plain). See <a href="https://www.wikipedia.org/wiki/List_of_HTTP_header_fields">wikipedia.org/wiki/List_of_HTTP_header_fields</a> for more information.',
'optional' => TRUE,
),
'method' => array(
'type' => 'text',
'label' => 'Method',
'description' => 'The HTTP request method, GET or POST.',
'options list' => 'rules_http_client_options_method',
'optional' => TRUE,
),
'data' => array(
'type' => 'text',
'label' => 'Data',
'description' => "The request body, formatter as 'param=value¶m=value&...' or one 'param=value' per line.",
'optional' => TRUE,
),
'max_redirects' => array(
'type' => 'integer',
'label' => 'Max redirects',
'description' => 'How many times a redirect may be followed.',
'default value' => 3,
'optional' => TRUE,
),
'timeout' => array(
'type' => 'decimal',
'label' => 'Timeout',
'description' => 'The maximum number of seconds the request may take.',
'default value' => 30,
'optional' => TRUE,
),
),
'provides' => array(
'http_response' => array(
'type' => 'text',
'label' => t('HTTP data'),
),
),
);
return $items;
}