Skip to content

Allow send only GET and POST methods #47

@xdan

Description

@xdan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions