# Method: PHPCrawler::addPostData()

## << Back to class-overview

Adds post-data together with an URL-rule to the list of post-data to send with requests.
Signature:

public addPostData($url_regex, $post_data_array)

Parameters:

$url_regex | string | Regular expression defining the URL(s) the post-data should be send to.
$post_data_array | array | Post-data-array, the array-keys are the post-data-keys, the array-values the post-values. (like array("post_key1" => "post_value1", "post_key2" => "post_value2")

Returns:

bool |

Description:

Example`$post_data = array("username" => "me", "password" => "my_password", "action" => "do_login");
$crawler->addPostData("#http://www\.foo\.com/login.php#", $post_data);`
This example sends the post-values "username=me", "password=my_password" and "action=do_login" to the URL
http://www.foo.com/login.php