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

HTML

Why does get work but not post?

When I assign get to the method attribute of my form the data is submitted successfully, but if I try to assign post to the method attribute I receive a message that tells me 'cannot POST'. Why is this?

Here is the link to my project: https://github.com/JustCant/FormProject

1 Answer

Steven Parker
Steven Parker
243,228 Points

What are you submitting it to (what kind of server)? And are you actually connected to a server with a browser, or are you running on some kind of editor/simulator?

The form submits data to another page that is part of the project called success.html. To be honest I don't have a full understanding of post and get so I'm not sure if what I'm trying to do makes sense or not.

Steven Parker
Steven Parker
243,228 Points

When you work with the form, what is it you are running? Is it a browser?

Yes. I'm using brackets text editor and running the page on chrome.

Steven Parker
Steven Parker
243,228 Points

So "brackets" is acting as the server then. I'm not familiar with it myself, but since "post" requires handling by the server, it's possible that it doesn't support that function, or needs some special configuration before it will.

Ok I see. I'll look more into that. Thank's for the input!