webTestCase->drupalPost() or drupal_http_request()? I'm writing a simpletest for a module that posts XML directly to a URL (it's on a closed system so there's no user or auth or anything at this point).

I've manually tested getting the response code by using drupal_http_request() to POST the file, but since I'm now doing the same thing in an actual simpletest, I feel like I should use webTestCase-&gt;drupalPost().

The only problem is that drupalPost() seems to expect a save button value. I'm not POSTing via a form with a submit button, so can I still use drupalPost()? Or should I just use drupal_http_request() in my simpletest?
As said in the documentation page for DrupalWebTestCase::drupalPost(), that method supposes to be called for a Drupal page containing a form; if that is not the case, you should use drupal_http_request().

The reason is that the method tries to emulate a click on a submit button, as said in the description for the $submit parameter.


  $submit: Value of the submit button whose click is to be emulated. For example, t('Save'). The processing of the request depends on this value. For example, a form may have one button with the value t('Save') and another button with the value t('Delete'), and execute different code depending on which one is clicked.