Re: [WebDNA] Receive JSON POST

This WebDNA talk-list message is from

2019


It keeps the original formatting.
numero = 114565
interpreted = N
texte = 2185 --00000000000009f37a058759fbbc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 th= at > 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 > --------------------------------------------------------- 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.u= s > > --------------------------------------------------------- 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.u= s > > > > --------------------------------------------------------- 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.u= s > > --------------------------------------------------------- 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.u= s > > > > --------------------------------------------------------- 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.u= s > > > --------------------------------------------------------- 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.u= s > > > --------------------------------------------------------- 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.u= s > > > --------------------------------------------------------- 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.u= s --00000000000009f37a058759fbbc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Stuart = / Michael,

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

So had a deeper l= ook at it.=C2=A0 I route all traffic through a single template using modrew= rite, I then add some apache server variables.

So = if you do something like this:

.htaccess
Rewri= teEngine On
RewriteRule ^jsonpos= t/(.+)$ /json-post.tmpl?dummyName=3D [L]
<= div>

json-post.tm= pl
FormVariables:
[formvariables][name]<= /div>
[/formvariables]

Then set your webhook / receiving URL to

<= div dir=3D"ltr">

You'll see the dat= a.=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 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 Par= liament 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> wrote:
Hi Michael

Are you able to specify the url to w= hich the JSON needs to be posted ?

I just tried pu= tting a ? at the end of the url eg: /test.html?

[S= HELL]curl -X POST -H "Content-Type: application/json" -d '{&q= uot;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]<= br>
[/FormVariables]

Try the example = above.


And thanks to Tom for sparki= ng a memory of a discussion I had with someone a while ago about WebDNA not= accepting a form value without a name.=C2=A0
In this case by usi= ng 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 wh= at are you using ?


Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA
=







On 25 Apr 2019, at 16:44, Michael D= avis <admin@net= work13.net> wrote:

Thanks Stuart,

Unfortunately, the sol= ution can't be changing the way the post is done.=C2=A0 That's the = way it is coming from the service that's sending it.=C2=A0 I see where = adding a name=3Dvalue pair in your post example causes WebDNA to find the F= ormVariable.=C2=A0 It is possible FormVariables is 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 Tremain <webdna@plsoftware.com.au> 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","passwo= rd":"mybirthday=E2=80=9D}'[/SHELL]

R= esult:
FormVariables
userinfo =3D {&q= uot;userName":"dim@witted.net","password":"mybirthday=E2=80=9D}<= /span>


However, this may be = a better solution for you as you will not have to parse the JSON:
<= br>
[SHELL]curl -k POST https://plsoftware.com.au/test.html -d username=3Ddim@witt= ed.net -d password=3Dmybirthday [/SHELL]

on th= e test.html page:

FormVariables<br>
[FormVariables name=3D&exact=3DF][name] =3D [value]<br>
[/FormVariables]

Note that I have de= clared each variable =C2=A0as a separate -d

The -k= means for curl to ignore ssl errors.

Make sure th= at your=C2=A0h= ttp://localhost/json_auth.dna=C2=A0is able to deal with the WebDNA.


Kind regards

Stuart Tremain
Pharoa= h Lane Software
AUSTRALIA






On 25 Apr 2019, at 02:28, Michael D= avis <admin@net= work13.net> wrote:

Stuart,

To avoid any browser specific issues, I= 9;m writing the [FormVariables] output to a file and then opening the file = with a text editor.

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


MD

April = 23, 2019 11:04 PM, "Stuart Tremain" <webdna@plsoftware.com.au> wrote:
H= ave you have a look at the source code of the resulting page ?
<= div>Sometimes, depending on the browser, it does not display on the rendere= d page.
Kind regards
Stuart Tremain
Pharoa= h Lane Software
AUSTRALIA
<= div>webdna@plsoftware.co= m.au



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

Sorry, that was a typo/mistake on my part. I was using [For= mVariables], not [ListVariables]. Nothing in the results. I've tested o= n FCGI and Server versions.


MD


April 23, 2019 6:44 PM= , "Stuart Tremain" <webdna@plsoftware.com.a= u> wrote:
Try
[FormVariables= name=3D&exact=3DF][name] =3D [value]<br>
[/FormVariab= les]
ListVariables will only= list TEXT vars etc.
Kind regards
Stuart Tremain
Pharoah Lane Software
AUSTRALIA
<= span style=3D"border-collapse:separate;font-variant-ligatures:normal;font-v= ariant-numeric:normal;font-variant-alternates:normal;font-variant-east-asia= n:normal;line-height:normal;border-spacing:0px">webdna@plsoftware.com.au
On 24 Apr 2019, at 11= :03, Michael Davis <admin@network13.net&= gt; wrote:
Hi All,
I'm trying to receive JSON via a p= ost and not seeing anything in form variables or mime headers. As a test, I= post using curl like so:
curl -X POST -H "Content-Typ= e: application/json" -d '{"userName":"dim@witted.net","password":"mybirthday&= quot;}' http://localhost/json_auth.dna<= /a>
On the receiving WebDNA= template:
---------------------------= ------------------------------ 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<= /a> archives: http://www.webdna.= us/page.dna?numero=3D55 Bug Reporting: suppor= t@webdna.us


--------------------------------------------------------- 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
<= /div> --------------------------------------------------------- This messag= e is sent to you because you are subscribed to the mailing list talk@w= ebdna.us To unsubscribe, E-mail to: talk-leave@webdna.us= archives: http://www.webdna.us/page.dna?numero=3D= 55 Bug Reporting: support@webdna.us


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

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

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

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@w= ebdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: suppo= rt@webdna.us --------------------------------------------------------- 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 --00000000000009f37a058759fbbc-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  2. Re: [WebDNA] Receive JSON POST (Michael Davis 2019)
  3. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  4. Re: [WebDNA] Receive JSON POST (Michael Davis 2019)
  5. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  6. Re: [WebDNA] Receive JSON POST (Tom Duke 2019)
  7. Re: [WebDNA] Receive JSON POST (Tom Duke 2019)
  8. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  9. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  10. Re: [WebDNA] Receive JSON POST (Tom Duke 2019)
  11. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  12. Re: [WebDNA] Receive JSON POST (Michael Davis 2019)
  13. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  14. Re: [WebDNA] Receive JSON POST ("Michael Davis" 2019)
  15. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  16. Re: [WebDNA] Receive JSON POST ("Michael Davis" 2019)
  17. Re: [WebDNA] Receive JSON POST (Stuart Tremain 2019)
  18. [WebDNA] Receive JSON POST (Michael Davis 2019)
2185 --00000000000009f37a058759fbbc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 th= at > 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 > --------------------------------------------------------- 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.u= s > > --------------------------------------------------------- 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.u= s > > > > --------------------------------------------------------- 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.u= s > > --------------------------------------------------------- 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.u= s > > > > --------------------------------------------------------- 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.u= s > > > --------------------------------------------------------- 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.u= s > > > --------------------------------------------------------- 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.u= s > > > --------------------------------------------------------- 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.u= s --00000000000009f37a058759fbbc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Stuart = / Michael,

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

So had a deeper l= ook at it.=C2=A0 I route all traffic through a single template using modrew= rite, I then add some apache server variables.

So = if you do something like this:

.htaccess
Rewri= teEngine On
RewriteRule ^jsonpos= t/(.+)$ /json-post.tmpl?dummyName=3D [L]
<= div>

json-post.tm= pl
FormVariables:
[formvariables][name]<= /div>
[/formvariables]

Then set your webhook / receiving URL to

<= div dir=3D"ltr">

You'll see the dat= a.=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 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 Par= liament 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> wrote:
Hi Michael

Are you able to specify the url to w= hich the JSON needs to be posted ?

I just tried pu= tting a ? at the end of the url eg: /test.html?

[S= HELL]curl -X POST -H "Content-Type: application/json" -d '{&q= uot;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]<= br>
[/FormVariables]

Try the example = above.


And thanks to Tom for sparki= ng a memory of a discussion I had with someone a while ago about WebDNA not= accepting a form value without a name.=C2=A0
In this case by usi= ng 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 wh= at are you using ?


Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA
=







On 25 Apr 2019, at 16:44, Michael D= avis <admin@net= work13.net> wrote:

Thanks Stuart,

Unfortunately, the sol= ution can't be changing the way the post is done.=C2=A0 That's the = way it is coming from the service that's sending it.=C2=A0 I see where = adding a name=3Dvalue pair in your post example causes WebDNA to find the F= ormVariable.=C2=A0 It is possible FormVariables is 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 Tremain <webdna@plsoftware.com.au> 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","passwo= rd":"mybirthday=E2=80=9D}'[/SHELL]

R= esult:
FormVariables
userinfo =3D {&q= uot;userName":"dim@witted.net","password":"mybirthday=E2=80=9D}<= /span>


However, this may be = a better solution for you as you will not have to parse the JSON:
<= br>
[shell]curl -k POST https://plsoftware.com.au/test.html -d username=3Ddim@witt= ed.net -d password=3Dmybirthday [/SHELL]

on th= e test.html page:

FormVariables<br>
[FormVariables name=3D&exact=3DF][name] =3D [value]<br>
[/FormVariables]

Note that I have de= clared each variable =C2=A0as a separate -d

The -k= means for curl to ignore ssl errors.

Make sure th= at your=C2=A0h= ttp://localhost/json_auth.dna=C2=A0is able to deal with the WebDNA.


Kind regards

Stuart Tremain
Pharoa= h Lane Software
AUSTRALIA






On 25 Apr 2019, at 02:28, Michael D= avis <admin@net= work13.net> wrote:

Stuart,

To avoid any browser specific issues, I= 9;m writing the [formvariables] output to a file and then opening the file = with a text editor.

[WriteFile file=3D[cart].txt][formvariables][na= me] =3D [value]
[/FormVariables][/WriteFile]


MD

April = 23, 2019 11:04 PM, "Stuart Tremain" <webdna@plsoftware.com.au> wrote:
H= ave you have a look at the source code of the resulting page ?
<= div>Sometimes, depending on the browser, it does not display on the rendere= d page.
Kind regards
Stuart Tremain
Pharoa= h Lane Software
AUSTRALIA
<= div>webdna@plsoftware.co= m.au



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

Sorry, that was a typo/mistake on my part. I was using [For= mVariables], not [listvariables]. Nothing in the results. I've tested o= n FCGI and Server versions.


MD


April 23, 2019 6:44 PM= , "Stuart Tremain" <webdna@plsoftware.com.a= u> wrote:
Try
[FormVariables= name=3D&exact=3DF][name] =3D [value]<br>
[/FormVariab= les]
ListVariables will only= list TEXT vars etc.
Kind regards
Stuart Tremain
Pharoah Lane Software
AUSTRALIA
<= span style=3D"border-collapse:separate;font-variant-ligatures:normal;font-v= ariant-numeric:normal;font-variant-alternates:normal;font-variant-east-asia= n:normal;line-height:normal;border-spacing:0px">webdna@plsoftware.com.au
On 24 Apr 2019, at 11= :03, Michael Davis <admin@network13.net&= gt; wrote:
Hi All,
I'm trying to receive JSON via a p= ost and not seeing anything in form variables or mime headers. As a test, I= post using curl like so:
curl -X POST -H "Content-Typ= e: application/json" -d '{"userName":"dim@witted.net","password":"mybirthday&= quot;}' http://localhost/json_auth.dna<= /a>
On the receiving WebDNA= template:
[listvariables][name]=3D[value]
[/ListVariables][listmimeheaders][name]=3D[value]
[/List= MIMEHeaders]
I get a list of the usual MIME H= eaders, none include the JSON. LIstVariables returns nothing.
Any way to see this data in WebDNA?
=
MD
------------------------------= --------------------------- This message is sent to you because you are sub= scribed to the mailing list talk@webdna.us To un= subscribe, E-mail to: talk-leave@webdna.us= archives: http://www.webdna.us/= page.dna?numero=3D55 Bug Reporting: support@w= ebdna.us
---------------------------= ------------------------------ 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<= /a> archives: http://www.webdna.= us/page.dna?numero=3D55 Bug Reporting: suppor= t@webdna.us


--------------------------------------------------------- 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
<= /div> --------------------------------------------------------- This messag= e is sent to you because you are subscribed to the mailing list talk@w= ebdna.us To unsubscribe, E-mail to: talk-leave@webdna.us= archives: http://www.webdna.us/page.dna?numero=3D= 55 Bug Reporting: support@webdna.us


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

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

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

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@w= ebdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: suppo= rt@webdna.us --------------------------------------------------------- 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 --00000000000009f37a058759fbbc-- . 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:

QuitFeedback & DBNotOpened errors (1997) [WebDNA] Script / function to find broken images (2015) Emailer (WebCat2) (1997) WebCat2 - Getting to the browser's username/password data (1997) requiring form fields? (2000) No Wanna Duppys (1998) Code problems - Help (2000) RE: [WebDNA] WebDNA Upgrade Question - eCommerce (2009) [writefile] remotely (2000) Image Pirating [protecting against] (2003) [WebDNA] php -> WebDNA: Can I do this with [tcpconnect]? (2013) WebCat consulting $ (1998) [OT] Puget Sound Meteorites? (2004) [WebDNA] SMTP via gmail is NOT POSSIBLE (2013) Assigning carts (1998) Random sort is not random at all..... (2000) Banners and sort of random display (1997) WebCatalog sales (1997) Just Testing (1997) Re:my First Ship table (1998)