{"action":"created","issue":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/4365","repository_url":"https://api.github.com/repos/Codeception/Codeception","labels_url":"https://api.github.com/repos/Codeception/Codeception/issues/4365/labels{/name}","comments_url":"https://api.github.com/repos/Codeception/Codeception/issues/4365/comments","events_url":"https://api.github.com/repos/Codeception/Codeception/issues/4365/events","html_url":"https://github.com/Codeception/Codeception/issues/4365","id":238810106,"number":4365,"title":"API data not transferred correctly","user":{"login":"elimentz","id":1410811,"avatar_url":"https://avatars3.githubusercontent.com/u/1410811?v=3","gravatar_id":"","url":"https://api.github.com/users/elimentz","html_url":"https://github.com/elimentz","followers_url":"https://api.github.com/users/elimentz/followers","following_url":"https://api.github.com/users/elimentz/following{/other_user}","gists_url":"https://api.github.com/users/elimentz/gists{/gist_id}","starred_url":"https://api.github.com/users/elimentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elimentz/subscriptions","organizations_url":"https://api.github.com/users/elimentz/orgs","repos_url":"https://api.github.com/users/elimentz/repos","events_url":"https://api.github.com/users/elimentz/events{/privacy}","received_events_url":"https://api.github.com/users/elimentz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-06-27T10:46:52Z","updated_at":"2017-06-27T11:03:21Z","closed_at":null,"body":"#### What are you trying to achieve?\r\nI'm trying to send POST request to a controller in my app. The request is sent correctly, but the HTTP headers and request data are not transmitted correctly, so the test fails\r\n\r\n\r\n```php\r\nclass SalesControllerCest {\r\n\r\n    /**\r\n     * @covers \\App\\Http\\Controllers\\SalesController::processOrderHook()\r\n     */\r\n    public function testProcessOrderHook(\\ApiTester $I)\r\n    {\r\n        $content = '{\"order\":{\"id\":2768,\"order_number\":2768}}';\r\n\r\n        $I->haveHttpHeader('X-Wc-Webhook-Signature', 'vflmAP07BGCKdpC4=');\r\n        $I->haveHttpHeader('Content-Type', 'application/json');\r\n        $I->sendPOST('/processOrder', $content);\r\n        $response = $I->grabResponse();\r\n\r\n        file_put_contents('tests/_support/error.html', $response);\r\n        dd('done');\r\n    }\r\n\r\n}\r\n```\r\n\r\n### Source code\r\n```php\r\nclass SalesController extends Controller {\r\n\r\n    public function processOrderHook(Request $req)\r\n    {\r\n        $body = $req->getContent();\r\n        $signature = $req->header('X-Wc-Webhook-Signature');\r\n\r\n        $data = json_decode($body);\r\n\r\n        if( !$this->checkSignature($signature, 'FooBar', $body) ) {\r\n            return Response::json( array( 'error' => 'Signature does not match' ) );\r\n        }\r\n\r\n        return Response::json( array( 'success' => 'OK' ) );\r\n    }\r\n}\r\n```\r\n### Response\r\n- My signature is empty\r\n\r\nI have no idea what I'm doing wrong or how I can fix this...\r\n\r\n\r\n### Details\r\n\r\n* Codeception version: 2.3 || c3: 2.0.12\r\n* PHP Version: 5.6.30\r\n* Operating System: ~ubuntu16.04.1+deb.sury.org+1\r\n* Installation type: Composer\r\n* XDebug version: 2.5.4\r\n* Suite configuration:\r\n\r\n```yml\r\nactor: Tester\r\npaths:\r\n    tests: tests\r\n    log: tests/_output\r\n    data: tests/_data\r\n    helpers: tests/_support\r\nsettings:\r\n    bootstrap: _bootstrap.php\r\n    colors: true\r\n    memory_limit: 1024M\r\nmodules:\r\n    config:\r\n        REST:\r\n            depends: PhpBrowser\r\n            url: http://my-url.dev/api\r\n        Laravel5:\r\n            environment_file: .env.testing\r\ncoverage:\r\n    enabled: true\r\n    remote: false\r\n    include:\r\n        - app/Console/*\r\n        - app/Http/*\r\n        - app/Models/*\r\n    exclude:\r\n        - app/Console/Kernel.php\r\n        - app/Http/Kernel.php\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/comments/311325693","html_url":"https://github.com/Codeception/Codeception/issues/4365#issuecomment-311325693","issue_url":"https://api.github.com/repos/Codeception/Codeception/issues/4365","id":311325693,"user":{"login":"Naktibalda","id":395992,"avatar_url":"https://avatars3.githubusercontent.com/u/395992?v=3","gravatar_id":"","url":"https://api.github.com/users/Naktibalda","html_url":"https://github.com/Naktibalda","followers_url":"https://api.github.com/users/Naktibalda/followers","following_url":"https://api.github.com/users/Naktibalda/following{/other_user}","gists_url":"https://api.github.com/users/Naktibalda/gists{/gist_id}","starred_url":"https://api.github.com/users/Naktibalda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Naktibalda/subscriptions","organizations_url":"https://api.github.com/users/Naktibalda/orgs","repos_url":"https://api.github.com/users/Naktibalda/repos","events_url":"https://api.github.com/users/Naktibalda/events{/privacy}","received_events_url":"https://api.github.com/users/Naktibalda/received_events","type":"User","site_admin":false},"created_at":"2017-06-27T11:03:21Z","updated_at":"2017-06-27T11:03:21Z","body":"Do you see it if you run codecept with `-vv` flag?"}}
{"actor":{"display_login":"Naktibalda"}}