[AWS] Reading the body of a POST as a String

Phil Costin philcostin at hotmail.com
Fri Jun 3 13:55:35 CEST 2011


 > Date: Fri, 3 Jun 2011 09:06:00 +0200
> From: pascal at obry.net
> To: philcostin at hotmail.com
> CC: aws at lists.adacore.com
> Subject: Re: [AWS] Reading the body of a POST as a String
> 
> 
> Phil,
> 
> > Thanks Pascal - I have tried this function before but gnat did not seem
> > to recognise that overload (the one which accepts a parameter of
> > AWS.Status.Data and returns a String or an Unbounded_String) - I may
> > have an error elsewhere though so it's probably something simple.
> 
> I see, that's because it is overloaded and can be ambiguous in some 
> cases, but for this you can use a qualified expression:
> 
>     MB : constant String := String'(AWS.Response.Message_Body (R));
> 
> Or if you have two procedure:
> 
> 
>     procedure P (M : String);
>     procedure P (M : Unbounded_String);
> 
> P (String'(AWS.Response.Message_Body (R)));
> 
> Note that if the message body is expected to be large it is better to 
> use the Unbounded_String version to avoid a stack overflow.
> 
> Pascal.

Hi again,

I have tried the above but actually, AWS.Response.Message_Body accepts a parameter of type AWS.Response.Data - what I'm trying to do is to read the body which is sent to the server by the client - as an (Unbounded) String during the execution of the dispatch handler. The signature is:

overriding function Dispatch (Handler : in RequestHandler; Request in AWS.Status.Data);

Thanks,
Phil
_______________________________________________
AWS mailing list
AWS at lists.adacore.com
/no-more-mailman.html 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/aws/attachments/20110603/8d750a7e/attachment.htm 


More information about the AWS mailing list