Behat / WebApiExtension

Behat extension to test web APIs
http://extensions.behat.org
MIT License
111 stars 114 forks source link

Improvement to iSendARequestWithFormData #57

Open andyOstrava opened 8 years ago

andyOstrava commented 8 years ago

Hi!

The Web API Extension is exactly what I was looking for and has been a huge help. When I tried to use iSendARequestWithFormData, however, I found that it was losing any headers I had already added.

I wanted to suggest something like the following at line 198:

        $this->addHeader('Content-Type', 'application/x-www-form-urlencoded');
        $this->request = new Request($method, $url, $this->headers, http_build_query($fields, null, '&'));

Is that reasonable? Many apologies if I'm missing something.