ILEastic icon indicating copy to clipboard operation
ILEastic copied to clipboard

Simplify sending just a status

Open m1h43l opened this issue 5 years ago • 2 comments

In many cases you just need to send a HTTP status back to the caller without any content. Currently you must do the following:

  response.status = IL_HTTP_NO_CONTENT;
  il_responseWrite(response : '');

It would be much better to have that in one call.

il_responseWriteStatus(response : IL_HTTP_NO_CONTENT);

m1h43l avatar Jul 30 '20 09:07 m1h43l

You should be able to do

response.status = IL_HTTP_NO_CONTENT;

return

.. otherwise it is a bug

On Thu, Jul 30, 2020 at 11:27 AM m1h43l [email protected] wrote:

In many cases you just need to send a HTTP status back to the caller without any content. Currently you must do the following:

response.status = IL_HTTP_NO_CONTENT; il_responseWrite(response : '');

It would be much better to have that in one call.

il_responseWriteStatus(response : IL_HTTP_NO_CONTENT);

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sitemule/ILEastic/issues/82, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHU32BPWMEMSVROBFCDR6E4HZANCNFSM4PNJO6OA .

NielsLiisberg avatar Jul 30 '20 11:07 NielsLiisberg

Ok. That works (probably ... haven't tested) but that is not obvious for the user. That only works because ILEastic sends a "finishing" chunk to the client and that finishing chunk uses the status of the response. But that is something the user of the API doesn't see.

With response.status = 204 you have set a value but didn't take any obvious action for the user. I am voting for something like already proposed in this issue.

m1h43l avatar Jul 30 '20 14:07 m1h43l

Won't implement.

m1h43l avatar Jun 06 '24 05:06 m1h43l