On 19-Mar-05 18:43:39 Francois PIETTE wrote:

>Actually, THttpCli.DoRequestAsync is implemented to trigger an exception if
>there is nothing to POST/PUT:

>    if ((Rq = httpPOST) or (Rq = httpPUT)) and
>       (not Assigned(FSendStream) or
>        (FSendStream.Position = FSendStream.Size)) then
>        raise EHttpException.Create('HTTP component has nothing to post or
>put',
>                                    httpErrNoData);

>I wonder if I should suppress this test (except not Assigned(FSendStream))
>so that empty data can be sent.
>Any opinion ?

IIRC the original test was (FSendStream.Size = 0).

The real question is if sending empty data (with the exception of
authentication phases but this is handled automatically) make sense
or not. I think no because in that case the GET could be used instead
of POST, but I'm not an http expert.

My observation is that this test will catch a common error, i.e the
stream is not "rewinded" when used a second time.

Anyone has complained that he cannot send an empty data using the
POST or PUT method?

A limit that I noticed about this topic is that actually it is not
possible to tell the component to not send the entire content of the
SendStream starting from the actual position.

BTW, the test on Rc can be changed in (Rq in [httpPost, httpPut])


Bye, Maurizio.


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to