Re: EMBPERL: accepting json Working Example

2016-09-20 Thread Donavon
This is what I was able to get working... I used a regular javascript "XMLHttpRequest()" rather than the jQuery "|$.ajax({||});" from my original request. | General Requirements: - Directory needs to be able to use an .htaccess file - perl JSON Module needs to be installed Suggested change

Re: EMBPERL: accepting json

2016-09-08 Thread Neil Gunton
Donavon wrote: That is how I generally make calls.. ie; request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); However this is a new world and when using pre-done libraries, outside contractors or creating a client API, using 'request.setRequestHeader("Content-type", "ap

Re: EMBPERL: accepting json

2016-09-08 Thread Donavon
That is how I generally make calls.. ie; request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); However this is a new world and when using pre-done libraries, outside contractors or creating a client API, using 'request.setRequestHeader("Content-type", "application/x

Re: EMBPERL: accepting json

2016-09-08 Thread Jean-Christophe Boggio
[- use Data::Dumper; $req = shift; print OUT "fdat : ".Dumper(%fdat); -] This will print in a terminal. Better : [- use Data::Dumper; $req = shift; warn "fdat : ".Dumper(%fdat); -] To see the result in apache's error.log -

Re: EMBPERL: accepting json

2016-09-08 Thread Jean-Christophe Boggio
Donavon, Could you try this script (as the doSomething.epl of your $.ajax() example) ? [- use Data::Dumper; $req = shift; print OUT "fdat : ".Dumper(%fdat); -] Just to be sure %fdat is empty. - To unsubscribe, e

Re: EMBPERL: accepting json

2016-09-08 Thread Neil Gunton
Donavon wrote: If I use Embperl to receive JSON data. That's where the issue arises. | var formData = {"data1":a,"data2":b,"data3":c}; $.ajax( {dataType:"json", contentType:"application/json; charset=UTF-8", url:'/folder1/doSomething1.epl', data:formData, success:function(response){ Curren

Re: EMBPERL: accepting json

2016-09-08 Thread Donavon
Yup. that's it. If I use Embperl to create JSON data no problem. I just do: [- | use| |JSON;|| $hash{'key'} = 'value||'; $json| |= encode_json(\||%hash||);| | $http_headers_out||{||'Content-Type'||} = ||"application/json; charset=utf-8"||; ||| || $escmode| |= 0;||| print

Re: EMBPERL: accepting json

2016-09-08 Thread Donavon
If the following call is made: |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;}}); ||doS

Re: EMBPERL: accepting json

On 09/08/2016 01:21 PM, Neil Gunton wrote: > I also generate application/xml responses using Embperl, Embperl can use perl modules to spit out anything that is a string of bits. -- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportio

Re: EMBPERL: accepting json

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

Re: EMBPERL: accepting json

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 t

Re: EMBPERL: accepting json

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 jo

Re: EMBPERL: accepting json

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 wrote: > Good to know that there are still some Embperl users out there. > > We have a large SAAS system ma

Re: EMBPERL: accepting json

On 09/02/2016 06:43 PM, Donavon 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?*