Re: [WebDNA] JSONobject

This WebDNA talk-list message is from

2020


It keeps the original formatting.
numero = 115187
interpreted = N
texte = 2816 --0000000000008e41ee05af8447a4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Christi=C3=A1n, His check out the thread from 2019 on this issue copied in below. Basically if you can specify the URL on your server that the data is posted to then put a ? at the end of the URL. You then should be able to capture the JSON using [formvariables][name][/formvariables] - Tom ---------- Forwarded message --------- From: Stuart Tremain Date: Fri, 26 Apr 2019 at 07:35 Subject: Re: [WebDNA] Receive JSON POST To: WebDNA Talk List Try this in your capture file [TABLE name=3Dclean&fields=3Dfrom,to] =E2=88=AB & [/TABLE] JsonString=3D[CONVERTWORDS table=3Dclean][FormVariables][name]=E2=88=AB[/Fo= rmVariables ][/CONVERTWORDS] Then all you need to do is deal with the trailing & The character is option-B you may get a =E2=88=AB in a password but I re= ally doubt it. Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au On 26 Apr 2019, at 15:56, Michael Davis wrote: Thanks Stuart. That also didn't work. I've narrowed it down to the way FormVariables is taking or parsing the data in. If I submit a post like this: curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName":"dim@witted.net","password":"mybirt&hday"}' http://localhost/wtve_auth.dna?json Notice the ampersand in the password. The output of [FormVariables][name][= / FormVariables] is: {"userName":"dim@witted.net","password":"mybirthday"} Notice the ampersand is stripped out. I'm guessing the parsing routine WebDNA uses is basically a ListWords type loop and it's using ampersand as a delimiter. Interestingly, while the raw [name] shows both halves of the string, that is, the string before the ampersand and the string after, using [name] elsewhere, such as in JSONStore, or in a text variable, is somehow still effected by the ampersand and only the string after the ampersand is used. Everything before it is lost. Give it a try yourself. MD On Apr 25, 2019, at 4:31 PM, Stuart Tremain wrote: Hi Michael Tom wrote a JSON parser some time back that I have used with good success. You may be able to have a fiddle with this to get your solution to work. [!]------------------- Pass json as JSONRESULT -----------------[/!] [!]------------------- Conversion table to strip non-breaking spaces -----------------[/!] [table name=3DjsonClean&fields=3Dfrom,to] %C2 %A0 [/table] [!]------------------- Conversion table to facilitate spliting into key:value pairs -----------------[/!] [table name=3DjsonSplitConversions&fields=3Dfrom,to] | ~~~~ \" ^^^^ [/table] [!]------------------- Convert back after spliting into key:value pairs -----------------[/!] [table name=3DjsonSplitConversionsBack&fields=3Dfrom,to] " ~~~~ | ^^^^ " [/table] [!]------------------- pass one - run the conversions -----------------[/!] [text]JSONRESULT=3D[convertwords table=3DjsonSplitConversions][convertchars table=3DjsonClean][JSONRESULT][/convertchars][/convertwords][/text] [!]------------------- pass two - add bar to just before each key:value pair -----------------[/!] [text]JSONRESULT=3D[grep search=3D("[^"]*"):&replace=3D|\1=3D][JSONRESULT][/grep][/text] [!]------------------- pass three - list out the key:value pairs and assign them to text variables -----------------[/!] [listwords words=3D[url][JSONRESULT][/url]&delimiters=3D|{}][!] [/!][text]THISVAL=3D[grep search=3D(,$)&replace=3D][getchars start=3D1&trim=3Dboth][convertwords table=3DjsonSplitConversionsBack][word][/convertwords][/getchars][/grep][/t= ext][!] [/!][hideif [url][THISVAL][/url]=3D][!] [/!][text]JSON-[THISVAL][/text][!] [/!][/hideif][!] [/!][/listwords][!] ------------------------------------------ [/!][SHOWIF [DEBUG]=3DT][!] [/!][listvariables name=3Djson-&exact=3DF][name] =3D [value]
[/listvariables][!] [/!][/SHOWIF] Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au On 26 Apr 2019, at 09:24, Michael Davis wrote: Thanks Stuart / Tom, More fun with this... Adding a ? alone for me didn't work, but putting a value after it kicked things into gear. curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName":"dim@witted.net","password":"mybirthday"}' http://localhost/wtve_auth.dna?json This ends up reversing the order so the contents of the JSON post are the NAME of the formvariable and the VALUE of the formvariable is "json". Interesting things happen when parsing though... [FormVariables name=3D&exact=3DF] [jsonstore table=3DjsonOject][name][/jsonstore] [search table=3DjsonOject&neuserNamedata=3D[blank]&max=3D1][founditems] [returnraw]HTTP/1.0 200 OK[eol]Status: 200[eol]Content-Type: application/ json[eol][eol][!] [/!]{"userName":"[userName]","password":"[password]"}[!] [/!][/returnraw] [/founditems][/search] [/FormVariables] That code works and spits back out the same json using the stored values. So far so good. However, when the password value in the json object contains an ampersand, it breaks the whole thing. I've tried various combinations of [url]'ing and am coming up with none that work. You can't URL the incoming JSON. JSONStore can't parse it. Any suggestions? I had no idea I was going to get stuck on such a simple task for so long, lol. Boo. Also, on a side note, you cannot use [listfields] on the magic table that JSONStore creates. MD On Apr 25, 2019, at 2:44 PM, Stuart Tremain wrote: Nice idea :) Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au On 25 Apr 2019, at 22:30, Tom Duke wrote: Stuart / Michael, Hi - it works on my CMS, but wouldn't work on a standard WebDNA template. So had a deeper look at it. I route all traffic through a single template using modrewrite, I then add some apache server variables. So if you do something like this: ..*htaccess* RewriteEngine On RewriteRule ^jsonpost/(.+)$ /json-post.tmpl?dummyName=3D [L] *json-post.tmpl* FormVariables: [formvariables][name] [/formvariables] Then set your webhook / receiving URL to https://your-domain/jsonpost/anything You'll see the data. Looks like you have to add at least one name:value pair. Not sure if this is an apache thing or a WebDNA thing, I suspect the latter. - Tom =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D On Thu, 25 Apr 2019 at 12:51, Stuart Tremain wrote: > Hi Michael > > Are you able to specify the url to which the JSON needs to be posted ? > > I just tried putting a ? at the end of the url eg: /test.html? > > [SHELL]curl -X POST -H "Content-Type: application/json" -d '{"userName":" > dim@witted.net","password":"mybirthday"}' -k > https://plsoftware.com.au/test.html?[/SHELL] > > Then putting this on your receiving page you will get the JSON string > > [FormVariables name=3D&exact=3DF][NAME]
> [/FormVariables] > > Try the example above. > > > And thanks to Tom for sparking a memory of a discussion I had with someon= e > a while ago about WebDNA not accepting a form value without a name. > In this case by using the ? the name becomes the value with no value > passed. > > Tom, you may be getting it to work on an older version =E2=80=A6 what are= you > using ? > > > Kind regards > > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > > > > > > > On 25 Apr 2019, at 16:44, Michael Davis wrote: > > Thanks Stuart, > > Unfortunately, the solution can't be changing the way the post is done. > That's the way it is coming from the service that's sending it. I see > where adding a name=3Dvalue pair in your post example causes WebDNA to fi= nd > the FormVariable. It is possible FormVariables is ignoring any header > that doesn't have a value for name. Good question for Christophe. > > MD > > On Apr 24, 2019, at 8:23 PM, Stuart Tremain > wrote: > > I tested this on a linux server: > > [SHELL]curl -k POST https://plsoftware.com.au/test.html -d > userinfo=3D'{"userName":"dim@witted.net","password":"mybirthday=E2=80=9D}= '[/SHELL] > > Result: > FormVariables > userinfo =3D {"userName":"dim@witted.net","password":"mybirthday=E2=80=9D= } > > > However, this may be a better solution for you as you will not have to > parse the JSON: > > [SHELL]curl -k POST https://plsoftware.com.au/test.html -d > username=3Ddim@witted.net -d password=3Dmybirthday [/SHELL] > > on the test.html page: > > FormVariables
> [FormVariables name=3D&exact=3DF][name] =3D [value]
> [/FormVariables] > > Note that I have declared each variable as a separate -d > > The -k means for curl to ignore ssl errors. > > Make sure that your http://localhost/json_auth.dna is able to deal with > the WebDNA. > > > Kind regards > > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > > > > > > > On 25 Apr 2019, at 02:28, Michael Davis wrote: > > Stuart, > > To avoid any browser specific issues, I'm writing the [FormVariables] > output to a file and then opening the file with a text editor. > > [WriteFile file=3D[cart].txt][FormVariables][name] =3D [value] > [/FormVariables][/WriteFile] > > > MD > > April 23, 2019 11:04 PM, "Stuart Tremain" > > wrote: > > Have you have a look at the source code of the resulting page ? > Sometimes, depending on the browser, it does not display on the rendered > page. > Kind regards > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > > > On 24 Apr 2019, at 15:55, Michael Davis wrote: > Stuart, > > Sorry, that was a typo/mistake on my part. I was using [FormVariables], > not [ListVariables]. Nothing in the results. I've tested on FCGI and Serv= er > versions. > > > MD > > > April 23, 2019 6:44 PM, "Stuart Tremain" > > wrote: > > Try > [FormVariables name=3D&exact=3DF][name] =3D [value]
> [/FormVariables] > ListVariables will only list TEXT vars etc. > Kind regards > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > On 24 Apr 2019, at 11:03, Michael Davis wrote: > Hi All, > I'm trying to receive JSON via a post and not seeing anything in form > variables or mime headers. As a test, I post using curl like so: > curl -X POST -H "Content-Type: application/json" -d '{"userName":" > dim@witted.net","password":"mybirthday"}' http://localhost/json_auth.dna > On the receiving WebDNA template: > [ListVariables][name]=3D[value] > [/ListVariables][ListMIMEHeaders][name]=3D[value] > [/ListMIMEHeaders] > I get a list of the usual MIME Headers, none include the JSON. > LIstVariables returns nothing. > Any way to see this data in WebDNA? > MD > > --0000000000008e41ee05af8447a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Christi=C3=A1n,

=
His check out the thread from 2019 on this issue copied in below= ..=C2=A0 Basically if you can specify the URL on your server that the data i= s posted to then put a ? at the end of the URL.

Yo= u then should be able to capture the JSON using [formvariables][name][/form= variables]

- Tom



---------- Forwarded message ---------
From:=C2=A0Stuart Tremain=C2=A0<webdna@plsoftware.com.au>
Date: Fri, 26 Apr 2019 at 07= :35
Subject: Re: [WebDNA] Receive=C2=A0JSON=C2=A0POST
To: WebDNA Talk List <talk@webdna.us>


Try this in your capture= file


[TABLE name=3Dclean&fields= =3Dfrom,to]
=E2=88=AB&
[/TABLE]
JsonString=3D[CONVERTWORDS table=3Dclea= n][FormVariables][name]=E2=88=AB[/FormVariables][/CONVERTWORDS]


Then all you need to do is deal with the trailing &

The character is option-B you may get a =C2=A0 =E2= =88=AB =C2=A0in a password but I really doubt it.

=
Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA







On 26 Apr 2019, at 15:56, Michael Davis <admin@network13.net> wrote:
=
T= hanks Stuart.=C2=A0 That also didn't work.=C2=A0 I've narrowed it d= own to the way=C2=A0FormVariables=C2=A0is t= aking or parsing the data in.

If I submit a post like th= is:

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName":&q= uot;dim@witted.net&= quot;,"password":"mybirt&hday"}'=C2=A0http://localhost= /wtve_auth.dna?json

Notice the ampersand in the password.=C2=A0 The output of [FormVariables][name][/FormVa= riables] is:

{"userName":"dim@witted.net",= "password":"mybirthday"}

Notic= e the ampersand is stripped out.=C2=A0 I'm guessing the parsing routine= WebDNA uses is basically a ListWords type loop and it's using ampersan= d as a delimiter.
Interestingly, while the raw [name] shows both = halves of the string, that is, the string before the ampersand and the stri= ng after, using [name] elsewhere, such as in JSONStore, or in a text variab= le, is somehow still effected by the ampersand and only the string after th= e ampersand is used.=C2=A0 Everything before it is lost.

Give it a try yourself. =C2=A0


MD

On Apr 25, 2019, at 4:31 P= M, Stuart Tremain <webdna@plsoftware.com.au> wrote:

Hi Michael

<= /div>
Tom wrote a=C2=A0JSON=C2=A0parser= some time back that I have used with good success.
You may be ab= le to have a fiddle with this to get your solution to work.

<= /div>

[!]------------------- Pass=C2=A0json=C2=A0as JSONRESULT -----------------[/!]
[!]------------------- Conversion table to strip non-breaking spaces ----= -------------[/!]
[table name=3DjsonClean&fields=3Dfrom,to]
%C2
%A0
[/table]
[!]-= ------------------ Conversion table to facilitate spliting into key:value p= airs -----------------[/!]
[table name=3DjsonSplitConversions&= ;fields=3Dfrom,to]
|= ~~~~
\"^^^^
[/table]
[!]------------------- Convert back after splitin= g into key:value pairs -----------------[/!]
[table name=3DjsonSp= litConversionsBack&fields=3Dfrom,to]
"
~~~~|
^^^^&q= uot;
[/table]
[!]------------------- pass one - run the= conversions -----------------[/!]
[text]JSONRESULT=3D[convertwor= ds table=3DjsonSplitConversions][convertchars table=3DjsonClean][JSONRESULT= ][/convertchars][/convertwords][/text]
[!]------------------- pas= s two - add bar to just before each key:value pair -----------------[/!]
[text]JSONRESULT=3D[grep search=3D("[^"]*"):&rep= lace=3D|\1=3D][JSONRESULT][/grep][/text]
[!]------------------- p= ass three - list out the key:value pairs and assign them to text=C2=A0variables=C2=A0-----------------[/!]
[= listwords words=3D[url][JSONRESULT][/url]&delimiters=3D|{}][!]
[/!][text]THISVAL=3D[grep se= arch=3D(,$)&replace=3D][getchars start=3D1&trim=3Dboth][convertword= s table=3DjsonSplitConversionsBack][word][/convertwords][/getchars][/grep][= /text][!]
[/!][hidei= f [url][THISVAL][/url]=3D][!]
[/!][text]JSON-[THISVAL][/text][= !]
[/!][/hideif][!]<= /div>
[/!][/listwords][!]
-----------------------------------= -------
[/!][SHOWIF [DEBUG]=3DT][!]
[/!][listvariables name=3Djson-&exact=3DF][name] =3D [value]<br>[/listvariables][!= ]
[/!][/SHOWIF]




Kind regards
Stuart Tremain
Pharoah Lane Software
AUSTR= ALIA


<= br>




On= 26 Apr 2019, at 09:24, Michael Davis <admin@network13.net> wrote:

Thanks Stuar= t / Tom,

More fun with this...

= Adding a ? alone for me didn't work, but putting a value after it kicke= d things into gear.

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName&quo= t;:"dim@witted.net= ","password":"mybirthday"}'=C2=A0http://localhost= /wtve_auth.dna?json
This ends up reversing the order so the contents of the=C2=A0<= span class=3D"gmail-il">JSON=C2=A0post are the NAME of the=C2=A0formvariable=C2=A0and the VALUE of the=C2=A0formvariable=C2=A0is "json".

Interesting things happen= when parsing though...

[= FormVariables=C2=A0name=3D&exact=3DF]
[jsonstore = table=3DjsonOject][name][/jsonstore]
[search table=3DjsonOject&am= p;neuserNamedata=3D[blank]&max=3D1][founditems]
[returnraw]HT= TP/1.0 200 OK[eol]Status: 200[eol]Content-Type: application/json[eol][eol][!]
[/!]{"userName":&quo= t;[userName]","password":"[password]"}[!]
[/!][/returnraw]
[/founditems][/search]
[/FormVariables]

That cod= e works and spits back out the same=C2=A0json=C2=A0using the stored values.=C2=A0 So far so good. =C2=A0
However, when the password value in the=C2=A0json=C2=A0object contains an ampersand, it breaks the whole t= hing.
I've tried various combinations of [url]'ing and am= coming up with none that work.

You can't URL = the incoming=C2=A0JSON. JSONStore can't= parse it.

Any suggestions?=C2=A0 I had no idea I = was going to get stuck on such a simple task for so long, lol.=C2=A0 Boo.

Also, on a side note, you cannot use [listfields] o= n the magic table that JSONStore creates.

MD
=

On Apr 25, 2019, at 2:44= PM, Stuart Tremain <webdna@plsoftware.com.au> wrote:

Nice idea :)

Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA
<= div>






On 25 Apr 2019, at 22:30, Tom Duke <= tom@revolutiona= ries.ie> wrote:

Stuart / Michael,

Hi - it = works on my CMS, but wouldn't work on a standard WebDNA template.
=

So had a deeper look at it.=C2=A0 I route all traffic t= hrough a single template using modrewrite, I then add some apache server=C2= =A0variables.

So i= f you do something like this:

.= htaccess
RewriteEngine On
RewriteRule ^jsonpost= /(.+)$ /json-post.tmpl?dummyName=3D [L]

json-post.tmpl<= /i>
FormVariables:
= [formvariables][name]
[/formvariables]

Then set your webhook / receiving URL to


=
You'll see the data.=C2=A0 Looks like you have to add at least one= name:value pair.=C2=A0 Not sure if this is an apache thing or a WebDNA thi= ng, I suspect the latter.

- Tom




=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
Digital Revolutionaries
1st Floor, Castleriver House
14-15 = Parliament Street
Temple Bar,Dublin 2
Ireland
--------------------= --------------------------
[t]: + 353 1 4403907
[e]: <mailto:tom@revolutionaries.= ie>
[w]: <http://www.revolutionaries.ie/>
=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


On Thu, 25 Apr 2019 at 12:51, Stuart Tremain <webdna@plsoftware.com.au&= gt; wrote:
Hi Michael

Are you able to sp= ecify the url to which the=C2=A0JSON=C2=A0n= eeds to be posted ?

I just tried putting a ? at th= e end of the url eg: /test.html?

[SHELL]curl -X PO= ST -H "Content-Type: application/json&= quot; -d '{"userName":"dim@witted.net","password":"mybi= rthday"}' -k=C2=A0https://plsoftware.com.au/test.html?[/SHELL]<= /div>

Then putting this on your receiving page you will = get the=C2=A0JSON=C2=A0string
[FormVariables=C2=A0name= =3D&exact=3DF][NAME]<br>
[/For= mVariables]

Try the example above.


And thanks to Tom for sparking a memory of = a discussion I had with someone a while ago about WebDNA not accepting a=C2= =A0form=C2=A0value without a name.=C2=A0
In this case by using the ? the name becomes the value with no valu= e passed.

Tom, you may be getting it to work on an= older version =E2=80=A6 what are you using ?


=
Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA
=



<= br>



On 25 Apr 20= 19, at 16:44, Michael Davis <admin@network13.net> wrote:

Thanks Stuart,
<= br>
Unfortunately, the solution can't be changing the way the= post is done.=C2=A0 That's the way it is coming from the service that&= #39;s sending it.=C2=A0 I see where adding a name=3Dvalue pair in your post= example causes WebDNA to find the=C2=A0FormVariab= le.=C2=A0 It is possible=C2=A0FormVariables= =C2=A0is ignoring any header that doesn't have a value for name.= =C2=A0 Good question for Christophe.

MD
On Apr 24, 2019, at 8:23 PM, Stuart Tremai= n <webdna@= plsoftware.com.au> wrote:

I tested this on a linux server:
<= br>
[SHELL]curl -k POST=C2=A0https://plsoftware.com.au/test.html=C2=A0= -d userinfo=3D'{"userName":"dim@witted.net","password":"= ;mybirthday=E2=80=9D}'[/SHELL]

Result:
FormVariables
userinfo =3D {"use= rName":"dim@w= itted.net","password":"mybirthday=E2=80=9D}


However, this may be a better solution for= you as you will not have to parse the=C2=A0JSON:

[SHELL]curl -k POST=C2=A0https://plsoftware.com.au/tes= t.html=C2=A0-d=C2=A0username=3Ddim@witted.net=C2=A0-d password=3Dmybirthday [/S= HELL]

on the test.html page:

<= div>
FormVariables<br>
= [FormVariables=C2=A0name=3D&exact=3DF][= name] =3D [value]<br>
[/FormVariab= les]

Note that I have declared each v= ariable =C2=A0as a separate -d

The -k means for cu= rl to ignore ssl errors.

Make sure that your=C2=A0= http://localho= st/json_auth.dna=C2=A0is able to deal with the WebDNA.


Kind regards

<= /div>
Stuart Tremain
Pharoah Lane Software
AUSTRALI= A



=




On 25= Apr 2019, at 02:28, Michael Davis <admin@network13.net> wrote:

Stuart,

To avo= id any browser specific issues, I'm writing the [FormVariables] output to a file and then opening the file with a = text editor.=C2=A0

[WriteFile file=3D[cart].txt][FormVariables][name] =3D [value]
[/FormVariables][/WriteFile]


MD

April 23, 2019 11:0= 4 PM, "Stuart Tremain" <webdna@plsoftware.com.au> wrote:
Have you have a lo= ok at the source code of the resulting page ?
Sometimes, dep= ending on the browser, it does not display on the rendered page.
=
Kind regards
Stuart Tremain=
Pharoah Lane Software
AUS= TRALIA



On 24 Apr 2019, at 15:55, Michael= Davis <admin@network13.net> wrote:
Stuart,

Sorry, that was a typo/mistake on my part. I was us= ing [FormVariables], not [ListVariables]. N= othing in the results. I've tested on FCGI and Server versions.

=
MD


April 23, 2019 6:44 PM, "Stuart Tremain" <webdna@plsoftware.com.au> wrote:
Try
[FormVariables=C2=A0name= =3D&exact=3DF][name] =3D [value]<br>
[/FormVariables]
L= istVariables will only list TEXT vars etc.
=
Kind regards
Stuart Tremain
Pharoah Lane Software
AUSTRALIA<= /div>
=
On 24 Apr 2019, at 11= :03, Michael Davis <admin@network13.net&= gt; wrote:
Hi All,
I'm trying to receive=C2=A0JSON=C2=A0via a post and not seeing anything in=C2=A0= form=C2=A0variable= s=C2=A0or mime headers. As a test, I post using curl like so:
<= div>
curl -X POST -H "Content-Type: application/json" -d '{"userName":"dim@witted.net","password":"mybirthday"}&= #39;=C2=A0http://localhost/json_auth.dna
=
=
<= /div>


--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --0000000000008e41ee05af8447a4-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] JSONobject (Tom Duke 2020)
  2. Re: [WebDNA] JSONobject (=?utf-8?Q?Cristi=C3=A1n_Tapia?= 2020)
  3. Re: [WebDNA] JSONobject (Stuart Tremain 2020)
  4. Re: [WebDNA] JSONobject (Tom Duke 2020)
  5. [WebDNA] JSONobject (=?utf-8?Q?Cristi=C3=A1n_Tapia?= 2020)
2816 --0000000000008e41ee05af8447a4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Christi=C3=A1n, His check out the thread from 2019 on this issue copied in below. Basically if you can specify the URL on your server that the data is posted to then put a ? at the end of the URL. You then should be able to capture the JSON using
[formvariables][name][/formvariables] - Tom ---------- Forwarded message --------- From: Stuart Tremain Date: Fri, 26 Apr 2019 at 07:35 Subject: Re: [WebDNA] Receive JSON POST To: WebDNA Talk List Try this in your capture file [TABLE name=3Dclean&fields=3Dfrom,to] =E2=88=AB & [/TABLE] JsonString=3D[CONVERTWORDS table=3Dclean][formvariables][name]=E2=88=AB[/Fo= rmVariables ][/CONVERTWORDS] Then all you need to do is deal with the trailing & The character is option-B you may get a =E2=88=AB in a password but I re= ally doubt it. Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au On 26 Apr 2019, at 15:56, Michael Davis wrote: Thanks Stuart. That also didn't work. I've narrowed it down to the way FormVariables is taking or parsing the data in. If I submit a post like this: curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName":"dim@witted.net","password":"mybirt&hday"}' http://localhost/wtve_auth.dna?json Notice the ampersand in the password. The output of [formvariables][name][= / FormVariables] is: {"userName":"dim@witted.net","password":"mybirthday"} Notice the ampersand is stripped out. I'm guessing the parsing routine WebDNA uses is basically a ListWords type loop and it's using ampersand as a delimiter. Interestingly, while the raw [name] shows both halves of the string, that is, the string before the ampersand and the string after, using [name] elsewhere, such as in JSONStore, or in a text variable, is somehow still effected by the ampersand and only the string after the ampersand is used. Everything before it is lost. Give it a try yourself. MD On Apr 25, 2019, at 4:31 PM, Stuart Tremain wrote: Hi Michael Tom wrote a JSON parser some time back that I have used with good success. You may be able to have a fiddle with this to get your solution to work. [!]------------------- Pass json as JSONRESULT -----------------[/!] [!]------------------- Conversion table to strip non-breaking spaces -----------------[/!] [table name=3DjsonClean&fields=3Dfrom,to] %C2 %A0 [/table] [!]------------------- Conversion table to facilitate spliting into key:value pairs -----------------[/!] [table name=3DjsonSplitConversions&fields=3Dfrom,to] | ~~~~ \" ^^^^ [/table] [!]------------------- Convert back after spliting into key:value pairs -----------------[/!] [table name=3DjsonSplitConversionsBack&fields=3Dfrom,to] " ~~~~ | ^^^^ " [/table] [!]------------------- pass one - run the conversions -----------------[/!] [text]JSONRESULT=3D[convertwords table=3DjsonSplitConversions][convertchars table=3DjsonClean][JSONRESULT][/convertchars][/convertwords][/text] [!]------------------- pass two - add bar to just before each key:value pair -----------------[/!] [text]JSONRESULT=3D[grep search=3D("[^"]*"):&replace=3D|\1=3D][JSONRESULT][/grep][/text] [!]------------------- pass three - list out the key:value pairs and assign them to text variables -----------------[/!] [listwords words=3D[url][JSONRESULT][/url]&delimiters=3D|{}][!] [/!][text]THISVAL=3D[grep search=3D(,$)&replace=3D][getchars start=3D1&trim=3Dboth][convertwords table=3DjsonSplitConversionsBack][word][/convertwords][/getchars][/grep][/t= ext][!] [/!][hideif [url][THISVAL][/url]=3D][!] [/!][text]JSON-[THISVAL][/text][!] [/!][/hideif][!] [/!][/listwords][!] ------------------------------------------ [/!][SHOWIF [DEBUG]=3DT][!] [/!][listvariables name=3Djson-&exact=3DF][name] =3D [value]
[/listvariables][!] [/!][/SHOWIF] Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au On 26 Apr 2019, at 09:24, Michael Davis wrote: Thanks Stuart / Tom, More fun with this... Adding a ? alone for me didn't work, but putting a value after it kicked things into gear. curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName":"dim@witted.net","password":"mybirthday"}' http://localhost/wtve_auth.dna?json This ends up reversing the order so the contents of the JSON post are the NAME of the formvariable and the VALUE of the formvariable is "json". Interesting things happen when parsing though... [FormVariables name=3D&exact=3DF] [jsonstore table=3DjsonOject][name][/jsonstore] [search table=3DjsonOject&neuserNamedata=3D[blank]&max=3D1][founditems] [returnraw]HTTP/1.0 200 OK[eol]Status: 200[eol]Content-Type: application/ json[eol][eol][!] [/!]{"userName":"[username]","password":"[password]"}[!] [/!][/returnraw] [/founditems][/search] [/FormVariables] That code works and spits back out the same json using the stored values. So far so good. However, when the password value in the json object contains an ampersand, it breaks the whole thing. I've tried various combinations of [url]'ing and am coming up with none that work. You can't URL the incoming JSON. JSONStore can't parse it. Any suggestions? I had no idea I was going to get stuck on such a simple task for so long, lol. Boo. Also, on a side note, you cannot use [listfields] on the magic table that JSONStore creates. MD On Apr 25, 2019, at 2:44 PM, Stuart Tremain wrote: Nice idea :) Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au On 25 Apr 2019, at 22:30, Tom Duke wrote: Stuart / Michael, Hi - it works on my CMS, but wouldn't work on a standard WebDNA template. So had a deeper look at it. I route all traffic through a single template using modrewrite, I then add some apache server variables. So if you do something like this: ..*htaccess* RewriteEngine On RewriteRule ^jsonpost/(.+)$ /json-post.tmpl?dummyName=3D [L] *json-post.tmpl* FormVariables: [formvariables][name] [/formvariables] Then set your webhook / receiving URL to https://your-domain/jsonpost/anything You'll see the data. Looks like you have to add at least one name:value pair. Not sure if this is an apache thing or a WebDNA thing, I suspect the latter. - Tom =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D On Thu, 25 Apr 2019 at 12:51, Stuart Tremain wrote: > Hi Michael > > Are you able to specify the url to which the JSON needs to be posted ? > > I just tried putting a ? at the end of the url eg: /test.html? > > [shell]curl -X POST -H "Content-Type: application/json" -d '{"userName":" > dim@witted.net","password":"mybirthday"}' -k > https://plsoftware.com.au/test.html?[/SHELL] > > Then putting this on your receiving page you will get the JSON string > > [FormVariables name=3D&exact=3DF][NAME]
> [/FormVariables] > > Try the example above. > > > And thanks to Tom for sparking a memory of a discussion I had with someon= e > a while ago about WebDNA not accepting a form value without a name. > In this case by using the ? the name becomes the value with no value > passed. > > Tom, you may be getting it to work on an older version =E2=80=A6 what are= you > using ? > > > Kind regards > > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > > > > > > > On 25 Apr 2019, at 16:44, Michael Davis wrote: > > Thanks Stuart, > > Unfortunately, the solution can't be changing the way the post is done. > That's the way it is coming from the service that's sending it. I see > where adding a name=3Dvalue pair in your post example causes WebDNA to fi= nd > the FormVariable. It is possible FormVariables is ignoring any header > that doesn't have a value for name. Good question for Christophe. > > MD > > On Apr 24, 2019, at 8:23 PM, Stuart Tremain > wrote: > > I tested this on a linux server: > > [shell]curl -k POST https://plsoftware.com.au/test.html -d > userinfo=3D'{"userName":"dim@witted.net","password":"mybirthday=E2=80=9D}= '[/SHELL] > > Result: > FormVariables > userinfo =3D {"userName":"dim@witted.net","password":"mybirthday=E2=80=9D= } > > > However, this may be a better solution for you as you will not have to > parse the JSON: > > [shell]curl -k POST https://plsoftware.com.au/test.html -d > username=3Ddim@witted.net -d password=3Dmybirthday [/SHELL] > > on the test.html page: > > FormVariables
> [FormVariables name=3D&exact=3DF][name] =3D [value]
> [/FormVariables] > > Note that I have declared each variable as a separate -d > > The -k means for curl to ignore ssl errors. > > Make sure that your http://localhost/json_auth.dna is able to deal with > the WebDNA. > > > Kind regards > > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > > > > > > > On 25 Apr 2019, at 02:28, Michael Davis wrote: > > Stuart, > > To avoid any browser specific issues, I'm writing the [formvariables] > output to a file and then opening the file with a text editor. > > [WriteFile file=3D[cart].txt][formvariables][name] =3D [value] > [/FormVariables][/WriteFile] > > > MD > > April 23, 2019 11:04 PM, "Stuart Tremain" > > wrote: > > Have you have a look at the source code of the resulting page ? > Sometimes, depending on the browser, it does not display on the rendered > page. > Kind regards > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > > > On 24 Apr 2019, at 15:55, Michael Davis wrote: > Stuart, > > Sorry, that was a typo/mistake on my part. I was using [formvariables], > not [listvariables]. Nothing in the results. I've tested on FCGI and Serv= er > versions. > > > MD > > > April 23, 2019 6:44 PM, "Stuart Tremain" > > wrote: > > Try > [FormVariables name=3D&exact=3DF][name] =3D [value]
> [/FormVariables] > ListVariables will only list TEXT vars etc. > Kind regards > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au > > On 24 Apr 2019, at 11:03, Michael Davis wrote: > Hi All, > I'm trying to receive JSON via a post and not seeing anything in form > variables or mime headers. As a test, I post using curl like so: > curl -X POST -H "Content-Type: application/json" -d '{"userName":" > dim@witted.net","password":"mybirthday"}' http://localhost/json_auth.dna > On the receiving WebDNA template: > [listvariables][name]=3D[value] > [/ListVariables][listmimeheaders][name]=3D[value] > [/ListMIMEHeaders] > I get a list of the usual MIME Headers, none include the JSON. > LIstVariables returns nothing. > Any way to see this data in WebDNA? > MD > > --0000000000008e41ee05af8447a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Christi=C3=A1n,

=
His check out the thread from 2019 on this issue copied in below= ..=C2=A0 Basically if you can specify the URL on your server that the data i= s posted to then put a ? at the end of the URL.

Yo= u then should be able to capture the JSON using [formvariables][name][/form= variables]

- Tom



---------- Forwarded message ---------
From:=C2=A0Stuart Tremain=C2=A0<webdna@plsoftware.com.au>
Date: Fri, 26 Apr 2019 at 07= :35
Subject: Re: [WebDNA] Receive=C2=A0JSON=C2=A0POST
To: WebDNA Talk List <talk@webdna.us>


Try this in your capture= file


[TABLE name=3Dclean&fields= =3Dfrom,to]
=E2=88=AB&
[/TABLE]
JsonString=3D[CONVERTWORDS table=3Dclea= n][FormVariables][name]=E2=88=AB[/FormVariables][/CONVERTWORDS]


Then all you need to do is deal with the trailing &

The character is option-B you may get a =C2=A0 =E2= =88=AB =C2=A0in a password but I really doubt it.

=
Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA







On 26 Apr 2019, at 15:56, Michael Davis <admin@network13.net> wrote:
=
T= hanks Stuart.=C2=A0 That also didn't work.=C2=A0 I've narrowed it d= own to the way=C2=A0FormVariables=C2=A0is t= aking or parsing the data in.

If I submit a post like th= is:

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName":&q= uot;dim@witted.net&= quot;,"password":"mybirt&hday"}'=C2=A0http://localhost= /wtve_auth.dna?json

Notice the ampersand in the password.=C2=A0 The output of [FormVariables][name][/FormVa= riables] is:

{"userName":"dim@witted.net",= "password":"mybirthday"}

Notic= e the ampersand is stripped out.=C2=A0 I'm guessing the parsing routine= WebDNA uses is basically a ListWords type loop and it's using ampersan= d as a delimiter.
Interestingly, while the raw [name] shows both = halves of the string, that is, the string before the ampersand and the stri= ng after, using [name] elsewhere, such as in JSONStore, or in a text variab= le, is somehow still effected by the ampersand and only the string after th= e ampersand is used.=C2=A0 Everything before it is lost.

Give it a try yourself. =C2=A0


MD

On Apr 25, 2019, at 4:31 P= M, Stuart Tremain <webdna@plsoftware.com.au> wrote:

Hi Michael

<= /div>
Tom wrote a=C2=A0JSON=C2=A0parser= some time back that I have used with good success.
You may be ab= le to have a fiddle with this to get your solution to work.

<= /div>

[!]------------------- Pass=C2=A0json=C2=A0as JSONRESULT -----------------[/!]
[!]------------------- Conversion table to strip non-breaking spaces ----= -------------[/!]
[table name=3DjsonClean&fields=3Dfrom,to]
%C2
%A0
[/table]
[!]-= ------------------ Conversion table to facilitate spliting into key:value p= airs -----------------[/!]
[table name=3DjsonSplitConversions&= ;fields=3Dfrom,to]
|= ~~~~
\"^^^^
[/table]
[!]------------------- Convert back after splitin= g into key:value pairs -----------------[/!]
[table name=3DjsonSp= litConversionsBack&fields=3Dfrom,to]
"
~~~~|
^^^^&q= uot;
[/table]
[!]------------------- pass one - run the= conversions -----------------[/!]
[text]JSONRESULT=3D[convertwor= ds table=3DjsonSplitConversions][convertchars table=3DjsonClean][JSONRESULT= ][/convertchars][/convertwords][/text]
[!]------------------- pas= s two - add bar to just before each key:value pair -----------------[/!]
[text]JSONRESULT=3D[grep search=3D("[^"]*"):&rep= lace=3D|\1=3D][JSONRESULT][/grep][/text]
[!]------------------- p= ass three - list out the key:value pairs and assign them to text=C2=A0variables=C2=A0-----------------[/!]
[= listwords words=3D[url][JSONRESULT][/url]&delimiters=3D|{}][!]
[/!][text]THISVAL=3D[grep se= arch=3D(,$)&replace=3D][getchars start=3D1&trim=3Dboth][convertword= s table=3DjsonSplitConversionsBack][word][/convertwords][/getchars][/grep][= /text][!]
[/!][hidei= f [url][THISVAL][/url]=3D][!]
[/!][text]JSON-[THISVAL][/text][= !]
[/!][/hideif][!]<= /div>
[/!][/listwords][!]
-----------------------------------= -------
[/!][SHOWIF [DEBUG]=3DT][!]
[/!][listvariables name=3Djson-&exact=3DF][name] =3D [value]<br>[/listvariables][!= ]
[/!][/SHOWIF]




Kind regards
Stuart Tremain
Pharoah Lane Software
AUSTR= ALIA


<= br>




On= 26 Apr 2019, at 09:24, Michael Davis <admin@network13.net> wrote:

Thanks Stuar= t / Tom,

More fun with this...

= Adding a ? alone for me didn't work, but putting a value after it kicke= d things into gear.

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userName&quo= t;:"dim@witted.net= ","password":"mybirthday"}'=C2=A0http://localhost= /wtve_auth.dna?json
This ends up reversing the order so the contents of the=C2=A0<= span class=3D"gmail-il">JSON=C2=A0post are the NAME of the=C2=A0formvariable=C2=A0and the VALUE of the=C2=A0formvariable=C2=A0is "json".

Interesting things happen= when parsing though...

[= FormVariables=C2=A0name=3D&exact=3DF]
[jsonstore = table=3DjsonOject][name][/jsonstore]
[search table=3DjsonOject&am= p;neuserNamedata=3D[blank]&max=3D1][founditems]
[returnraw]HT= TP/1.0 200 OK[eol]Status: 200[eol]Content-Type: application/json[eol][eol][!]
[/!]{"userName":&quo= t;[username]","password":"[password]"}[!]
[/!][/returnraw]
[/founditems][/search]
[/FormVariables]

That cod= e works and spits back out the same=C2=A0json=C2=A0using the stored values.=C2=A0 So far so good. =C2=A0
However, when the password value in the=C2=A0json=C2=A0object contains an ampersand, it breaks the whole t= hing.
I've tried various combinations of [url]'ing and am= coming up with none that work.

You can't URL = the incoming=C2=A0JSON. JSONStore can't= parse it.

Any suggestions?=C2=A0 I had no idea I = was going to get stuck on such a simple task for so long, lol.=C2=A0 Boo.

Also, on a side note, you cannot use [listfields] o= n the magic table that JSONStore creates.

MD
=

On Apr 25, 2019, at 2:44= PM, Stuart Tremain <webdna@plsoftware.com.au> wrote:

Nice idea :)

Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA
<= div>






On 25 Apr 2019, at 22:30, Tom Duke <= tom@revolutiona= ries.ie> wrote:

Stuart / Michael,

Hi - it = works on my CMS, but wouldn't work on a standard WebDNA template.
=

So had a deeper look at it.=C2=A0 I route all traffic t= hrough a single template using modrewrite, I then add some apache server=C2= =A0variables.

So i= f you do something like this:

.= htaccess
RewriteEngine On
RewriteRule ^jsonpost= /(.+)$ /json-post.tmpl?dummyName=3D [L]

json-post.tmpl<= /i>
FormVariables:
= [formvariables][name]
[/formvariables]

Then set your webhook / receiving URL to


=
You'll see the data.=C2=A0 Looks like you have to add at least one= name:value pair.=C2=A0 Not sure if this is an apache thing or a WebDNA thi= ng, I suspect the latter.

- Tom




=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
Digital Revolutionaries
1st Floor, Castleriver House
14-15 = Parliament Street
Temple Bar,Dublin 2
Ireland
--------------------= --------------------------
[t]: + 353 1 4403907
[e]: <mailto:tom@revolutionaries.= ie>
[w]: <http://www.revolutionaries.ie/>
=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


On Thu, 25 Apr 2019 at 12:51, Stuart Tremain <webdna@plsoftware.com.au&= gt; wrote:
Hi Michael

Are you able to sp= ecify the url to which the=C2=A0JSON=C2=A0n= eeds to be posted ?

I just tried putting a ? at th= e end of the url eg: /test.html?

[shell]curl -X PO= ST -H "Content-Type: application/json&= quot; -d '{"userName":"dim@witted.net","password":"mybi= rthday"}' -k=C2=A0https://plsoftware.com.au/test.html?[/SHELL]<= /div>

Then putting this on your receiving page you will = get the=C2=A0JSON=C2=A0string
[FormVariables=C2=A0name= =3D&exact=3DF][NAME]<br>
[/For= mVariables]

Try the example above.


And thanks to Tom for sparking a memory of = a discussion I had with someone a while ago about WebDNA not accepting a=C2= =A0form=C2=A0value without a name.=C2=A0
In this case by using the ? the name becomes the value with no valu= e passed.

Tom, you may be getting it to work on an= older version =E2=80=A6 what are you using ?


=
Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA
=



<= br>



On 25 Apr 20= 19, at 16:44, Michael Davis <admin@network13.net> wrote:

Thanks Stuart,
<= br>
Unfortunately, the solution can't be changing the way the= post is done.=C2=A0 That's the way it is coming from the service that&= #39;s sending it.=C2=A0 I see where adding a name=3Dvalue pair in your post= example causes WebDNA to find the=C2=A0FormVariab= le.=C2=A0 It is possible=C2=A0FormVariables= =C2=A0is ignoring any header that doesn't have a value for name.= =C2=A0 Good question for Christophe.

MD
On Apr 24, 2019, at 8:23 PM, Stuart Tremai= n <webdna@= plsoftware.com.au> wrote:

I tested this on a linux server:
<= br>
[shell]curl -k POST=C2=A0https://plsoftware.com.au/test.html=C2=A0= -d userinfo=3D'{"userName":"dim@witted.net","password":"= ;mybirthday=E2=80=9D}'[/SHELL]

Result:
FormVariables
userinfo =3D {"use= rName":"dim@w= itted.net","password":"mybirthday=E2=80=9D}


However, this may be a better solution for= you as you will not have to parse the=C2=A0JSON:

[shell]curl -k POST=C2=A0https://plsoftware.com.au/tes= t.html=C2=A0-d=C2=A0username=3Ddim@witted.net=C2=A0-d password=3Dmybirthday [/S= HELL]

on the test.html page:

<= div>
FormVariables<br>
= [FormVariables=C2=A0name=3D&exact=3DF][= name] =3D [value]<br>
[/FormVariab= les]

Note that I have declared each v= ariable =C2=A0as a separate -d

The -k means for cu= rl to ignore ssl errors.

Make sure that your=C2=A0= http://localho= st/json_auth.dna=C2=A0is able to deal with the WebDNA.


Kind regards

<= /div>
Stuart Tremain
Pharoah Lane Software
AUSTRALI= A



=




On 25= Apr 2019, at 02:28, Michael Davis <admin@network13.net> wrote:

Stuart,

To avo= id any browser specific issues, I'm writing the [FormVariables] output to a file and then opening the file with a = text editor.=C2=A0

[WriteFile file=3D[cart].txt][FormVariables][name] =3D [value]
[/FormVariables][/WriteFile]


MD

April 23, 2019 11:0= 4 PM, "Stuart Tremain" <webdna@plsoftware.com.au> wrote:
Have you have a lo= ok at the source code of the resulting page ?
Sometimes, dep= ending on the browser, it does not display on the rendered page.
=
Kind regards
Stuart Tremain=
Pharoah Lane Software
AUS= TRALIA



On 24 Apr 2019, at 15:55, Michael= Davis <admin@network13.net> wrote:
Stuart,

Sorry, that was a typo/mistake on my part. I was us= ing [FormVariables], not [listvariables]. N= othing in the results. I've tested on FCGI and Server versions.

=
MD


April 23, 2019 6:44 PM, "Stuart Tremain" <webdna@plsoftware.com.au> wrote:
Try
[FormVariables=C2=A0name= =3D&exact=3DF][name] =3D [value]<br>
[/FormVariables]
L= istVariables will only list TEXT vars etc.
=
Kind regards
Stuart Tremain
Pharoah Lane Software
AUSTRALIA<= /div>
=
On 24 Apr 2019, at 11= :03, Michael Davis <admin@network13.net&= gt; wrote:
Hi All,
I'm trying to receive=C2=A0JSON=C2=A0via a post and not seeing anything in=C2=A0= form=C2=A0variable= s=C2=A0or mime headers. As a test, I post using curl like so:
<= div>
curl -X POST -H "Content-Type: application/json" -d '{"userName":"dim@witted.net","password":"mybirthday"}&= #39;=C2=A0http://localhost/json_auth.dna
[listvariables][name]=3D[value]
[= /ListVariables][listmimeheaders][name]=3D[value]
[/ListMIMEHeader= s]
I get a list of the usual MIME Headers, none = include the=C2=A0JSON. LIstVariables return= s nothing.
Any way to see this data in WebDNA?
MD
=
=
<= /div>


--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --0000000000008e41ee05af8447a4-- . Tom Duke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCatalog2 Feature Feedback (1996) Order not created error (1997) Price recalc based on quantity (1997) Numbers from Sentence (2003) Cart problem (1999) Email/Order to fax? (2003) Separate SSL Server (1997) Looking For WebCatalog Migration Assistance (2003) Catalog page question (1999) error: Too many nested [xxx] contexts (1997) A few questions. . . (1997) Re1000001: Setting up shop (1997) Review comparison by PC Magazine: Open for On-line Business (1997) Tcp Connect and the disappearing page (2000) Error: Too many nested [xxx] contexts (1997) Invoking a MP3 Download (2004) RequiredFields template (1997) F2 to F3 rocky transition (1997) Sending Email (2004) Separate SSL Server (1997)