On Tue, 1 Nov 2011, Ludo Brands wrote:

On Tue, Nov 1, 2011 at 9:04 AM, Ludo Brands
<ludo.bra...@free.fr> wrote:
Note the "per the HTML specs". HTTP specs aren't that strict.

But what exaxtly do these specs ban? Because I am sending via
XMLHttpRequest in JavaScript, and there you can specify any
mime-type that you want. You can send any data and I haven't
seen any restriction related to the mime-type so far.
Probably this restrictions don't apply to JavaScript but only
to form data and things like that (purely in HTML)?


Yes. The HTML spec defines the use of these 2 MIME types for a user agent
uploading a form. XMLHttpRequest, as the name indicates, isn't limited to
HTML.

Not to mention that a CGI application can also communicate
with native clients, not only HTML pages, and the native
client is not subject to HTML rules.


There are plenty of applications using http as a communication channel and
that have nothing to do with html.

All this is correct, but the primary function of HTTP remains the transport of web-pages. fcl-web was/is geared towards that.

That said, it's of course not so that fcl-web should restrict itself to HTML.
I will look into having an event or so to handle unknown encodings.

For the time being, you can do the following:

1. create a descendent of TRequest (actually TCGIRequest) and override InitPostVars. 2. Then create a TCGIHandler descendent to override TCgiHandler.CreateRequest to
   instantiate your TCGIRequest descendant
3. Make a descendent of TCustomCGIApplication that overrides 
InitializeWebHandler
   which instantiates your TCGIHandler descendent. Use that descendent as your 
application object.

A bit cumbersome, but it gets the job done. (I had to do it myself on one 
particular occasion).

I'll look into making it a bit easier to do. (including the event to handle 
unknown encodings)

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to