[Laszlo-user] Change in the way lzpostbody works in 3.2?

James Howe openlaszlo at wingspread.imap-mail.com
Wed Mar 29 09:21:22 EST 2006


Thank you!

This little change makes all the difference in the world.  Now my POSTed  
XML is actually part of the content of the request and not one of the  
parameters.

BTW, have you had a chance to look at the zip file I sent you a couple  
days ago concerning the differences in the way my sample program runs in  
Flash 8 vs Flash 7?

On Wed, 29 Mar 2006 08:59:32 -0500, Henry Minsky <henry.minsky at gmail.com>  
wrote:

> This might fix the problem you are seeing with not bein able to set  
> custom headers. Try putting this at the start of your app.
>
>
> <script>
> LzLoadQueue.qargs.push('headers');
> </script>
>
>
>
>
> On 3/27/06, James Howe <openlaszlo at wingspread.imap-mail.com> wrote:
>>
>> I'm trying to get my application to work under 3.2 and I've run into a
>> problem with submitting information to my back end server via POST.   
>> Take
>> this program, for example:
>>
>> <canvas debug="true">
>>      <dataset name="ds">
>>         <foo><bar id="25030"/></foo>
>>      </dataset>
>>      <dataset name="updater" type="http"/>
>>         <view>
>>                 <button onclick="doit()">Push Me
>>                         <method name="doit">
>>                                 var pointer = ds.getPointer();
>>                                 updater.setSrc("http://localhost/test/foo
>> ");
>>                                 updater.setHeader("Content-Type",
>> "application/xml");
>>                                 updater.setQueryType("POST");
>>                                 updater.setQueryParam("lzpostbody",
>> pointer.serialize());
>>                                 updater.doRequest();
>>                         </method>
>>                 </button>
>>         </view>
>> </canvas>
>>
>> I have a simple servlet which writes information to a log file based on
>> the information contained in the request.  When I run this program under
>> 3.1.1, I get my XML content as the content of the request (I ask the
>> request for the content length and then get an input stream on the  
>> request
>> and read the content).  Under 3.1.1, the content information is this:
>>
>> Content-Type: application/xml
>> Content-Length: 41
>> Content: <ds><foo><bar>Some Stuff</bar></foo></ds>
>>
>> However, when I run the same application under 3.2, the content is not
>> retrievable via the input stream for the request, instead, the content  
>> is
>> contained as a parameter value.  My servlet produces the following
>> information for the content:
>>
>> Content-Type: application/x-www-form-urlencoded;charset=UTF-8
>> Content-Length: 37
>> Content:
>>
>> Something obviously changed.  If 3.2 has some improvement which  
>> corrects a
>> defect in 3.1.1, I'm happy to make code changes to work with the new way
>> of doing things.  I've already had to do that with namespaces.   
>> Basically
>> what I need to be able to do is execute a POST operation with arbitrary
>> XML as the posted value.  I'm not posting a form, I'm using a REST-style
>> interaction where I want to POST some XML which is used to update a
>> resource identified by the URL.
>>
>> Thanks!
>>
>> --
>> James Howe
>> _______________________________________________
>> Laszlo-user mailing list
>> Laszlo-user at openlaszlo.org
>> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



-- 
James Howe


More information about the Laszlo-user mailing list