{"action":"created","issue":{"url":"https://api.github.com/repos/nock/nock/issues/344","repository_url":"https://api.github.com/repos/nock/nock","labels_url":"https://api.github.com/repos/nock/nock/issues/344/labels{/name}","comments_url":"https://api.github.com/repos/nock/nock/issues/344/comments","events_url":"https://api.github.com/repos/nock/nock/issues/344/events","html_url":"https://github.com/nock/nock/issues/344","id":93914545,"node_id":"MDU6SXNzdWU5MzkxNDU0NQ==","number":344,"title":".reply callback requestBody should automatically parse to JSON","user":{"login":"vhpoet","id":686185,"node_id":"MDQ6VXNlcjY4NjE4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/686185?v=4","gravatar_id":"","url":"https://api.github.com/users/vhpoet","html_url":"https://github.com/vhpoet","followers_url":"https://api.github.com/users/vhpoet/followers","following_url":"https://api.github.com/users/vhpoet/following{/other_user}","gists_url":"https://api.github.com/users/vhpoet/gists{/gist_id}","starred_url":"https://api.github.com/users/vhpoet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhpoet/subscriptions","organizations_url":"https://api.github.com/users/vhpoet/orgs","repos_url":"https://api.github.com/users/vhpoet/repos","events_url":"https://api.github.com/users/vhpoet/events{/privacy}","received_events_url":"https://api.github.com/users/vhpoet/received_events","type":"User","site_admin":false},"labels":[{"id":902695,"node_id":"MDU6TGFiZWw5MDI2OTU=","url":"https://api.github.com/repos/nock/nock/labels/feature","name":"feature","color":"02e10c","default":false},{"id":98528146,"node_id":"MDU6TGFiZWw5ODUyODE0Ng==","url":"https://api.github.com/repos/nock/nock/labels/help%20wanted","name":"help wanted","color":"5319e7","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-07-08T23:43:23Z","updated_at":"2018-09-13T20:43:10Z","closed_at":"2016-05-10T19:21:27Z","author_association":"NONE","body":"I feel like the requestBody should automatically be parsed to JSON. It's a string on my example.\n\nDoesn't work\n\n``` javascript\nhttp.post('http://service/endpoint')\n    .set('Content-Type', 'application/json')\n    .send({\"id\": \"1\"})\n\nnock('http://service')\n  .post('/endpoint')\n  .reply(200, function(uri, requestBody) {\n    requestBody.id = 'overwrite';\n\n    return requestBody;\n  });\n```\n\nWorks\n\n``` javascript\nhttp.post('http://service/endpoint')\n    .set('Content-Type', 'application/json')\n    .send({\"id\": \"1\"})\n\nnock('http://service')\n  .post('/endpoint')\n  .reply(200, function(uri, requestBody) {\n    requestBody = JSON.parse(requestBody);\n    requestBody.id = 'overwrite';\n\n    return requestBody;\n  });\n```\n"},"comment":{"url":"https://api.github.com/repos/nock/nock/issues/comments/421146505","html_url":"https://github.com/nock/nock/issues/344#issuecomment-421146505","issue_url":"https://api.github.com/repos/nock/nock/issues/344","id":421146505,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTE0NjUwNQ==","user":{"login":"lock[bot]","id":33595554,"node_id":"MDM6Qm90MzM1OTU1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/in/6672?v=4","gravatar_id":"","url":"https://api.github.com/users/lock%5Bbot%5D","html_url":"https://github.com/apps/lock","followers_url":"https://api.github.com/users/lock%5Bbot%5D/followers","following_url":"https://api.github.com/users/lock%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/lock%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/lock%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lock%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/lock%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/lock%5Bbot%5D/repos","events_url":"https://api.github.com/users/lock%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/lock%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-09-13T20:43:10Z","updated_at":"2018-09-13T20:43:10Z","author_association":"NONE","body":"This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!\n"}}
{"actor":{"display_login":"lock"}}