Closed sebastiaanviaene closed 4 years ago
to clarify, this is how I solved it now. Overriding the request step defintion.
public function requestPath($path, $method = null) {
$this->setRequestPath($path);
if (null !== $method) {
$this->setRequestMethod($method);
}
$request = $this->sendRequest();
if(isset($this->requestOptions['multipart'])) {
$this->requestOptions['multipart'] = [];
}
return $request;
}
I'll do PR tonight.
@kopaygorodsky Any progress?
@christeredvartsen sory, had very busy week. Will do on this weekend.
Closing this because of lack of activity, and that I'm not sure if this is a bug or not. When making multiple requests within the same scenario, I'm not sure what the best behavior would be:
Feel free to reopen and continue the discussion if you are still using the project and would like this part to be improved.
Probably a separate step to clean the multipart options would help here.
The "Given I clear request options" step is something I had to add myself because my get request would return an error saying
Invalid resource type: unknown type (InvalidArgumentException)
The reason was that the multipart requestoptions were still set from the post request at the top of this scenario. I suggest including clearing the multipart requestoptions after each request.This is the code I use to clear it :
My temporary solution right now is to overwrite the "I Request with : path and :method" with my own version which includes this clear. But I would love to see it used by default.