diff --git a/src/Context/RestContext.php b/src/Context/RestContext.php index a3173a7a..dd1d21f8 100644 --- a/src/Context/RestContext.php +++ b/src/Context/RestContext.php @@ -54,12 +54,10 @@ public function iSendARequestToWithParameters($method, $url, TableNode $data) $files[$row['key']] = rtrim($this->getMinkParameter('files_path'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.substr($row['value'],1); } else { - $parameters[] = sprintf('%s=%s', $row['key'], $row['value']); + $parameters[$row['key']] = $row['value']; } } - parse_str(implode('&', $parameters), $parameters); - return $this->request->send( $method, $this->locatePath($url), diff --git a/tests/features/rest.feature b/tests/features/rest.feature index d113be26..39d79538 100644 --- a/tests/features/rest.feature +++ b/tests/features/rest.feature @@ -51,6 +51,13 @@ Feature: Testing RESTContext """ Then the response should be empty + Scenario: request parameter with dot + https://github.com/Behatch/contexts/issues/256 + When I send a POST request to "/rest/index.php" with parameters: + | key | value | + | item.id | 1 | + Then I should see "item.id=1" + Scenario: Add header Given I add "xxx" header equal to "yyy" When I send a GET request to "/rest/index.php"