comp.lang.ada
 help / color / mirror / Atom feed
From: Pascal Obry <pascal@obry.net>
Subject: Re: AWS: what is the difference between Response.Acknowledge and Response.Build ?
Date: Mon, 03 Nov 2014 18:16:38 +0100
Date: 2014-11-03T18:16:38+01:00	[thread overview]
Message-ID: <1415034998.3986.135.camel@obry.net> (raw)
In-Reply-To: slrnm5em83.nrc.lithiumcat@nat.rebma.instinctive.eu


Hello Natasha, 

> 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);` ?

If I rememeber correctly these two calls are 100% equivalent. But the
Acknowledge as different default parameter making it easier to use when
replying:

   return Acknowledge (S404);

> What is an "error message"? Does it include 3xx HTTP codes?

The message displayed by the Web browser.

-- 
  Pascal Obry /  Magny Les Hameaux (78)

  The best way to travel is by means of imagination

  http://v2p.fr.eu.org
  http://www.obry.net

  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


      reply	other threads:[~2014-11-03 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 10:29 AWS: what is the difference between Response.Acknowledge and Response.Build ? Natasha Kerensikova
2014-11-03 17:16 ` Pascal Obry [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox