perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donavon <d...@mycopanet.com>
Subject Re: EMBPERL: accepting json
Date Thu, 08 Sep 2016 19:06:26 GMT
If the following call is made:

<script>

|varformData 
={"data1":a,"data2":b,"data3":c};$.ajax({dataType:"json",contentType 
:"application/json; charset=UTF-8",url:'/folder1/doSomething1.epl',data 
:formData,success:function(response){CurrentArray=response;}}); </script> ||doSomething1.epl|
 doesn't receive the JSON data as %fdat. %fdat is empty.





On 9/8/2016 10:18 AM, Ruben Safir wrote:
> On 09/08/2016 01:04 PM, Donavon wrote:
>> I agree with all of the responses that Embed perl was made to mainly use
>> CGI.pm and multipart/form-data and really shouldn't be used outside of that.
>>
>> BUT As long as there is possibility that it might be able to receive
>> application/json data I have to look for a way to do it.  It's part of
>> my job to look for solutions that work within current limitations.
>>
>> If every response to this email is "It's not possible" that is something
>> I can take to a meeting.  If the responses are "You shouldn't or it's
>> difficult" then I have to keep searching for a solution that is
>> understandable and workable.
>>
>> I'm willing to pay a small consulting fee or a donation to a charity,
>> for assistance in figuring this out.
>>
>> So what are the suggestions for handling a call like this on a script by
>> script basis.  I might be possible to limit the scripts accepting these
>> calls to specific directories.
>>
>> |varformData
>> ={"data1":a,"data2":b,"data3":c};$.ajax({dataType:"json",contentType
>> :"application/json; charset=UTF-8",url:'/folder1/doSomething1.epl',data
>> :formData,success:function(response){CurrentArray=response;}}); Thank
>> You, ~Donavon |
>>
>>
>>
>>
>>
>>
>> On 9/4/2016 2:30 AM, Michael Smith wrote:
>>> I wouldn't use embperl to accept json.  I see embperl as being
>>> designed for HTML output, so I don't really see how it helps when
>>> dealing with json.
>>>
>>> On Fri, Sep 2, 2016 at 11:43 PM, Donavon <donl@mycopanet.com
>>> <mailto:donl@mycopanet.com>> wrote:
>>>
>>>      Good to know that there are still some Embperl users out there.
>>>
>>>      We have a large SAAS system mainly in Embperl, so our usage of
>>>      Embperl is not going away anytime soon.
>>>
>>>
>>>      My current question to the Embperl community is:
>>>
>>>      *How to accept **application/json?*
>>>
>>>      **I know that "Embperl uses CGI.pm internally to process forms
>>>      encoded with multipart/form-data" and that get processed into %fdat.
>>>
>>>      Is there a way to disable this behavior dynamically per page to
>>>      accept application/json data.
>>>
>>>      Thanks,
>>>      ~Donavon
>>>
>>>
>>>
>>>
>
> Your not understanding or I'm not understanding.  JSOM is a CLIENT
> technology and EMBPERL is a server technology.  It can process ANY input
> and it doesn't give a darn about application/json.
>
> all the form data is in %fdat, whether you like it or not, and it is
> done on the server side.  If you don't want to use something from the
> hash, don't use it.  %fdat in of itself does not produce any html
>
>


Mime
View raw message