I try in cept send OPTIONS request
$I = new ApiTester($scenario);
$I->wantTo('Check cross origin request method');
$I->haveHttpHeader('Access-Control-Request-Method', 'OPTIONS');
$I->sendOptions('?action=files');
echo $I->grabResponse();// it shows GET
And on server I just show $_SERVER['REQUEST_METHOD'] in first line of index.php.
echo $_SERVER['REQUEST_METHOD'];
die;
And it shows GET.
It works for GET and POST, but does not work for PUT/OPTIONS
My yaml config
class_name: ApiTester
modules:
enabled:
- REST:
url: 'http://localhost:8081'
depends: PhpBrowser
part: [json]
- \Helper\Api
- Asserts
I try in cept send
OPTIONSrequestAnd on server I just show $_SERVER['REQUEST_METHOD'] in first line of
index.php.And it shows
GET.It works for GET and POST, but does not work for PUT/OPTIONS
My yaml config