Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Build a Simple Dynamic Site with Node.js HTTP Methods and Headers Dealing with the POST Body

kushalmahajan2
kushalmahajan2
7,683 Points

Username doesn't shows up on hitting search

Hi, Here is the snapshot of the workspace. Please let me know where I am going wrong ! Link : http://w.trhou.se/gl9jp7bktt

Also, uncaught exception events.js:85
throw er; // Unhandled 'error' event
keep showing up. My search page and username page runs fine though

4 Answers

rydavim
rydavim
18,814 Points

Oddly, I only get this error intermittently when previewing your code. Sometimes it throws the error, sometimes it works fine. I would contact support directly using help@teamtreehouse.com to report that there may be a bug. Sorry you're having this issue, it does not seem to be a problem with your code.

kushalmahajan2
kushalmahajan2
7,683 Points

Reported the same. Will post my reply here once resolved.

kushalmahajan2
kushalmahajan2
7,683 Points

This was resolved. help@....com replied that forums are best way for such things and they will get a teacher around to solve this issue. I haven't got a reply as such from their end despite a follow up email. However, After a day or two the issue was gone. Thanks!

from the message.method

message.rawHeaders

The raw request/response headers list exactly as they were received.

Note that the keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the odd-numbered offsets are the associated values.

Header names are not lowercased, and duplicates are not merged.

// Prints something like: // // [ 'user-agent', // 'this is invalid because there can be only one', // 'User-Agent', // 'curl/7.22.0', // 'Host', // '127.0.0.1:8000', // 'ACCEPT', // '/' ] console.log(request.rawHeaders);

from the message.method

message.rawHeaders

The raw request/response headers list exactly as they were received.

Note that the keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the odd-numbered offsets are the associated values.

Header names are not lowercased, and duplicates are not merged.

// Prints something like: // // [ 'user-agent', // 'this is invalid because there can be only one', // 'User-Agent', // 'curl/7.22.0', // 'Host', // '127.0.0.1:8000', // 'ACCEPT', // '/' ] console.log(request.rawHeaders);