Skip to content
Browse files

Allow the setting of additional headers

  • Loading branch information...
1 parent 5850461 commit 853503093dbd51fc4eadc6caaaaee1563c79f5c7 Thomas Birch committed May 11, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 Behat/CommonContexts/WebApiContext.php
View
13 Behat/CommonContexts/WebApiContext.php
@@ -56,6 +56,19 @@ public function iAmAuthenticatingAs($username, $password)
}
/**
+ * Sets a HTTP Header.
+ *
+ * @param string $name header name
+ * @param string $value header value
+ *
+ * @Given /^I set header "([^"]*)" with value "([^"]*)"$/
+ */
+ public function iSetHeaderWithValue($name, $value)
+ {
+ $this->addHeader($name.': '.$value);
+ }
+
+ /**
* Sends HTTP request to specific relative URL.
*
* @param string $method request method

0 comments on commit 8535030

Please sign in to comment.
Something went wrong with that request. Please try again.