This project is read-only.

Using controller and POST forms

Feb 13, 2009 at 12:09 PM
Hello I use ControllerModule and my own controller (ModuleController) derived from ViewController. I implemented methods ModuleController.Test and ModuleController.Info which I use to create dynamic data for web pages. It works fine. But when I inserted post form infot my web page <form method="post" action="/module/info"> method ModuleController.Info was not called. I inserted breakpoint into HttpClientContextImp and I saw received string POST /module/info... But HttpClientContextImp wanted to read more data from the stream, but it has all data from client and  no new data received and connection was closed. Do you have some example how to process POST forms? Is not there a bug?

Best regards
Feb 13, 2009 at 12:39 PM
Does your controller work with get?

HttpClientContextImp will always read if HTTP v1.1 is used and keep-alive is active (which is default)
Feb 13, 2009 at 1:09 PM
Yes with get controller works fine.
Feb 13, 2009 at 1:11 PM
Can you post the complete POST request here? With headers and body.
Feb 13, 2009 at 1:24 PM
POST /module/info HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv: Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: cs,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1250,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 13

Feb 13, 2009 at 2:11 PM
I have same issues when making a POST with body data, specially with large bodies.

I have submitted a bug with patch that works for my case:

Feb 24, 2009 at 10:53 AM
try again with the latest revision.