{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/body-parser/issues/220","repository_url":"https://api.github.com/repos/expressjs/body-parser","labels_url":"https://api.github.com/repos/expressjs/body-parser/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/body-parser/issues/220/comments","events_url":"https://api.github.com/repos/expressjs/body-parser/issues/220/events","html_url":"https://github.com/expressjs/body-parser/issues/220","id":203901694,"number":220,"title":"Body of response is undefined.","user":{"login":"zgavin1","id":9595970,"avatar_url":"https://avatars.githubusercontent.com/u/9595970?v=3","gravatar_id":"","url":"https://api.github.com/users/zgavin1","html_url":"https://github.com/zgavin1","followers_url":"https://api.github.com/users/zgavin1/followers","following_url":"https://api.github.com/users/zgavin1/following{/other_user}","gists_url":"https://api.github.com/users/zgavin1/gists{/gist_id}","starred_url":"https://api.github.com/users/zgavin1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zgavin1/subscriptions","organizations_url":"https://api.github.com/users/zgavin1/orgs","repos_url":"https://api.github.com/users/zgavin1/repos","events_url":"https://api.github.com/users/zgavin1/events{/privacy}","received_events_url":"https://api.github.com/users/zgavin1/received_events","type":"User","site_admin":false},"labels":[{"id":73534989,"url":"https://api.github.com/repos/expressjs/body-parser/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"assignees":[{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2017-01-29T22:30:55Z","updated_at":"2017-01-30T00:12:55Z","closed_at":"2017-01-30T00:12:55Z","body":"Hey there, thanks for keeping this library in great shape!\r\n\r\nI'm working with express for the first time, and at the moment like the title says I cannot get the response body property when hitting Express endpoints in my project. I roughly followed this tutorial http://mherman.org/blog/2015/02/12/postgresql-and-nodejs/#.WIz4RLYrK2w.\r\n\r\nI have working endpoints that I can visit in the browser and query with cURL commands, but for some reason the response body is always undefined when I hit them from the client side of my app.\r\n\r\n```js\r\nvar express = require('express');\r\nvar path = require('path');\r\n// var favicon = require('serve-favicon');\r\nvar logger = require('morgan');\r\nvar cookieParser = require('cookie-parser');\r\nvar bodyParser = require('body-parser');\r\nvar cors = require('cors')\r\n\r\n// var users = require('./routes/users');\r\nvar routes = require('./routes/index.js');\r\nvar app = express();\r\n\r\n// view engine setup\r\napp.set('views', path.join(__dirname, 'views'));\r\napp.set('view engine', 'jade');\r\n\r\napp.use(cors());\r\n\r\n// uncomment after placing your favicon in /public\r\n// app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));\r\napp.use(logger('dev'));\r\napp.use(bodyParser.urlencoded({ extended: true }));\r\napp.use(bodyParser.json());\r\napp.use(cookieParser());\r\napp.use('/', routes);\r\napp.use(function (req, res) {\r\n  res.setHeader('Content-Type', 'application/json')\r\n  console.log('testing', res);\r\n  res.end()\r\n})\r\n```\r\n\r\nMost of the stack overflow questions seem to just point out that the creation of routes should come after calls to app.use with bodyParser, which I already have. And the rest of them just say to make sure you set the content type in the request, which I do. I'm at a bit of a loss. If you want to see the route I'm using I can post that too."},"comment":{"url":"https://api.github.com/repos/expressjs/body-parser/issues/comments/275957954","html_url":"https://github.com/expressjs/body-parser/issues/220#issuecomment-275957954","issue_url":"https://api.github.com/repos/expressjs/body-parser/issues/220","id":275957954,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2017-01-30T00:12:55Z","updated_at":"2017-01-30T00:12:55Z","body":"Huh, I don't see any body-parser logs and even then, I don't see any request that this module would be parsing (just a single GET request that typically has no body for this module to parse).\r\n\r\nThanks for that code, but it's just making a get request, not making a post or other request with a body for this module to parse.\r\n\r\nSo, I think that would answer why your req.body is undefined: There is no body in the request you are showing above, which is pretty much how get requests work. This module is intended to parse any incoming body, typically one you are sending using the POST, PUT, or PATCH verb. I hope that helps!"}}
{"actor":{"display_login":"dougwilson"}}