How can I get $_POST data in a callback? I've implemented hook_menu roughly as follows:

function sample_menu() {
    return array(
        'path/to/things' =&gt; array(
            'page callback' =&gt; 'callback_function',
            'access arguments' =&gt; array('access content'),
            'page arguments' =&gt; array(),
            'type' =&gt; MENU_CALLBACK
        )
    );
}


I want to be able to post data to this url. So says $_POST is the following array:

array(
    'data1' =&gt; 'value1',
    'data2' =&gt; 'value2',
)


How can I access $_POST['data1'] and $_POST['data2'] inside the callback? Directly accessing $_POST seems to not work (it's var_dumped as empty).
They access $_POST in the same way other functions do. 

Take file_ajax_upload() as example; it contains the following code.

  if (empty($_POST['form_build_id']) || $form_build_id != $_POST['form_build_id']) {
    // Invalid request.
    drupal_set_message(t('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (@size) that this server supports.', array('@size' =&gt; format_size(file_upload_max_size()))), 'error');
    $commands = array();
    $commands[] = ajax_command_replace(NULL, theme('status_messages'));
    return array('#type' =&gt; 'ajax', '#commands' =&gt; $commands);
  }


The function is a page callback defined in file_menu().

  $items['file/ajax'] = array(
    'page callback' =&gt; 'file_ajax_upload', 
    'delivery callback' =&gt; 'ajax_deliver', 
    'access arguments' =&gt; array('access content'), 
    'theme callback' =&gt; 'ajax_base_page_theme', 
    'type' =&gt; MENU_CALLBACK,
  );