Closed hiromik closed 7 years ago
Not entirely sure what you want to achieve.
Are you using the proxy
request option, but can't figure out a way to use this in the Behat API extension?
I want to know how you pass the option ['proxy' => ''] to the Guzzle client that's being used by the extension, workplace has a proxy that breaks my scenarios by returning a 503 error that I can fix by disabling the proxy.
Do you have a class that extends the context class from the extension? If so you can try to add a proxy
element to the request options property:
<?php
class MyContext extends ApiContext {
public function __construct() {
$this->requestOptions['proxy'] = '';
}
}
Is your code publicly available?
I have exactly a class extending that ApiContext, I was following the guide here : https://behat-api-extension.readthedocs.io/en/latest/guide/extending-the-extension.html#manipulate-the-api-client and wanted to know how you'd disable the proxy using setClient() I will try your method though.
@hiromik Closing this issue for now. If the above method did not work for you, feel free to reopen.
Hi @christeredvartsen,
I was using the context https://github.com/knpuniversity/rest/blob/master/features/api/ApiFeatureContext.php but decided to use this behat-api-extension, my only issue is that I need to disable the proxy which I used to do in the constructor of the class.
I've read the part about extending the extension, could anyone show me how to disable proxy using the middleware ? Thanks