From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: AWS: what is the difference between Response.Acknowledge and Response.Build ? Date: Mon, 3 Nov 2014 10:29:22 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: Injection-Date: Mon, 3 Nov 2014 10:29:22 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="76a49b86bc3e16725b7cfca3d85cb4c8"; logging-data="10558"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Na5/kWRcQVsn+9vkArQTD" User-Agent: slrn/1.0.1 (FreeBSD) Cancel-Lock: sha1:gy9XiXlhUgNuMl6aNxqpTk47/H0= Xref: number.nntp.giganews.com comp.lang.ada:190295 Date: 2014-11-03T10:29:22+00:00 List-Id: Hello, I have little question about these functions in AWS.Response: function Build (Content_Type : String; Message_Body : String; Status_Code : Messages.Status_Code := Messages.S200; Cache_Control : Messages.Cache_Option := Messages.Unspecified; Encoding : Messages.Content_Encoding := Messages.Identity) return Data with Post => not Is_Empty (Build'Result); -- Return a message whose body is passed into Message_Body. The -- Content_Type parameter is the MIME type for the message -- body. Status_Code is the response status (see Messages.Status_Code -- definition). function Acknowledge (Status_Code : Messages.Status_Code; Message_Body : String := ""; Content_Type : String := MIME.Text_HTML) return Data -- Returns a message to the Web browser. This routine must be used to -- send back an error message to the Web browser. For example if a -- requested resource cannot be served a message with status code S404 -- must be sent. What is exactly the difference between `Build (Type_Str, Body_Str, S404);` and `Acknowledge (S404, Body_Str, Type_Str);` ? Peeking into the implementation, it seems there is currently no difference between them, however the quoted comments imply a semantic difference. I guess that means that it means that an implementation difference might emerge in the future. The problem with comments is that they can be a bit more ambiguous than Ada code. Is "must" as strong as when it is used in RFCs? Or is more like a piece of advice? What is an "error message"? Does it include 3xx HTTP codes? Or am I wrong interpreting the comments, with Acknowldge and Build equivalent when a response body is present, while Acknowldge is able to build header-only responses? Thanks in advance for your insights, Natasha