I have a function that works perfectly fine but I realized I'm using a POST function when it's probably proper to use PUT.
I switched app.post('/word', docType, function (req. res) {
to app.put
Then in the html I switched:
<form action="/mediaDev/word" method="post" enctype="multipart/form-data">
to: method="put"
After making this change I end up getting 502 Bad Gateway
.
Is there a crucial difference between POST and PUT that I'm missing here?
Have you inspected the actual request being made? It is probably a GET.
See "Using PUT method in HTML form" for more information...
EDIT: On second thought I'm not certain why this would mean you get a 502 Bad Gateway, however I will leave this answer as I believe it is still useful.