{"action":"created","issue":{"url":"https://api.github.com/repos/request/request/issues/1484","labels_url":"https://api.github.com/repos/request/request/issues/1484/labels{/name}","comments_url":"https://api.github.com/repos/request/request/issues/1484/comments","events_url":"https://api.github.com/repos/request/request/issues/1484/events","html_url":"https://github.com/request/request/issues/1484","id":61865938,"number":1484,"title":"Impossible to write response text in file.","user":{"login":"FlamesoFF","id":5371279,"avatar_url":"https://avatars.githubusercontent.com/u/5371279?v=3","gravatar_id":"","url":"https://api.github.com/users/FlamesoFF","html_url":"https://github.com/FlamesoFF","followers_url":"https://api.github.com/users/FlamesoFF/followers","following_url":"https://api.github.com/users/FlamesoFF/following{/other_user}","gists_url":"https://api.github.com/users/FlamesoFF/gists{/gist_id}","starred_url":"https://api.github.com/users/FlamesoFF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlamesoFF/subscriptions","organizations_url":"https://api.github.com/users/FlamesoFF/orgs","repos_url":"https://api.github.com/users/FlamesoFF/repos","events_url":"https://api.github.com/users/FlamesoFF/events{/privacy}","received_events_url":"https://api.github.com/users/FlamesoFF/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-15T17:02:34Z","updated_at":"2015-03-17T05:29:36Z","closed_at":null,"body":"It's possible somehow to write response text in a file? For example I wanna get script. This code isn't working:\r\n\r\n```javascript\r\nrequest.get(\"https://samplesite/sample_script.js\")\r\n        .pipe(fs.createWriteStream(\"sample_script.js\"))\r\n        .pipe(gulp.dest(\"/scripts/\"));\r\n```\r\n\r\nResult is error:  **Error: Cannot pipe. Not readable.**"},"comment":{"url":"https://api.github.com/repos/request/request/issues/comments/82117317","html_url":"https://github.com/request/request/issues/1484#issuecomment-82117317","issue_url":"https://api.github.com/repos/request/request/issues/1484","id":82117317,"user":{"login":"froatsnook","id":10405574,"avatar_url":"https://avatars.githubusercontent.com/u/10405574?v=3","gravatar_id":"","url":"https://api.github.com/users/froatsnook","html_url":"https://github.com/froatsnook","followers_url":"https://api.github.com/users/froatsnook/followers","following_url":"https://api.github.com/users/froatsnook/following{/other_user}","gists_url":"https://api.github.com/users/froatsnook/gists{/gist_id}","starred_url":"https://api.github.com/users/froatsnook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/froatsnook/subscriptions","organizations_url":"https://api.github.com/users/froatsnook/orgs","repos_url":"https://api.github.com/users/froatsnook/repos","events_url":"https://api.github.com/users/froatsnook/events{/privacy}","received_events_url":"https://api.github.com/users/froatsnook/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T05:29:36Z","updated_at":"2015-03-17T05:29:36Z","body":"```\r\nrequest(\"http://github.com\")\r\n    .pipe(fs.createWriteStream(\"TEST.txt\"));\r\n```\r\n\r\nwill write the result to TEST.txt.  I think the problem is that `fs.createWriteStream` writes to file directly, whereas you probably want to use `gulp.dest` or something."}}