Overview
Features
Download
Documentation
Community
Add-Ons & Services

HTMLForm and HTTP PUT Request

Please post support and help requests here.

HTMLForm and HTTP PUT Request

Postby signalfrax » 05 Mar 2010, 13:54

I noticed that the HTMLForm class has been coded to process only GET and POST requests.
I naively enabled it by adding the following lines to the methods in HTMLForm.cpp:

void HTMLForm::load(const HTTPRequest& request, std::istream& requestBody, PartHandler& handler)
void HTMLForm::prepareSubmit(HTTPRequest& request)

CHANGED:
if (request.getMethod() == HTTPRequest::HTTP_POST)
{
....
}
TO:
if (request.getMethod() == HTTPRequest::HTTP_POST || request.getMethod() == HTTPRequest::HTTP_PUT )
{
....
}

is this going to break something??
signalfrax
 
Posts: 5
Joined: 10 Dec 2009, 16:53

Re: HTMLForm and HTTP PUT Request

Postby signalfrax » 05 Mar 2010, 16:38

After a couple of tests. Everything seems to be working fine using HTMLForm class to process HTTP PUT METHODS using content-type: application/x-www-form-urlencoded. Next week I will test it with other content-types and keep you updated.
signalfrax
 
Posts: 5
Joined: 10 Dec 2009, 16:53

Re: HTMLForm and HTTP PUT Request

Postby guenter » 09 Mar 2010, 19:05

Since PUT and POST are handled the same in the HTTP client and server classes, there shouldn't be an issue. Although I find using PUT instead of POST for handling form data a bit strange ;-)
guenter
 
Posts: 1107
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron