|
=Stuart / Michael,Hi - it works on my C=MS, but wouldn't work on a standard WebDNA template.So had a deeper look at it.=C2=A0 I route all traffic through a sing=le template using modrewrite, I then add some apache server variables.So if you do something like this:=<=/div>.htaccessRewriteEngine On=RewriteRule ^jsonpost/(.+)$ /json-post.tmpl?dummyName=3D [L] json-post.tmpl<=div>FormVariables: [formvariables][name]<=div>[/formvariables]
Then set your webhook =/ receiving URL to
Hi Michael---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list talk@w=ebdna.usTo unsubscribe, E-mail to: talk-leave@webdna.usarchives: http://www.webdna.us/page.dna?numero=3D55Bug Reporting: suppo=rt@webdna.usAre yo=u 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.htm=l?[shell]curl -X POST -H "Content-Type: appl=ication/json" -d '{"userName":"dim@witted.net","password&quo=t;:"mybirthday"}' -k https://plsoftware.com.au/test.html?[/SHE=LL]Then putting this on your receiving page y=ou will get the JSON string[FormVariables na=me=3D&exact=3DF][NAME]<br>[/FormVariables]<=br>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.=C2=A0= In this case by using the ? the name becomes the value with no v=alue passed.Tom, you may be getting it to work on= an older version =E2=80=A6 what are you using ?<=br>On 25 Apr 2019, at 16:44, Michael D=avis <admin@net=work13.net> wrote:Thanks Stuart,=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's sen=ding it.=C2=A0 I see where adding a name=3Dvalue pair in your post example =causes WebDNA to find the FormVariable.=C2=A0 It is possible FormVariables =is ignoring any header that doesn't have a value for name.=C2=A0 Good q=uestion for Christophe.MD---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list talk@w=ebdna.usTo unsubscribe, E-mail to: talk-leave@webdna.usarchives: http://www.webdna.us/page.dna?numero=3D55Bug Reporting: suppo=rt@webdna.usOn Apr 24, 2019, at 8:23 PM, Stuart Tremain <webdna@plsoftware.co=m.au> wrote:I tested this on a linux server: [shell]curl -k POST https://plsoftware.com.au/test.html -d user=info=3D'{"userName":"dim@witted.net","password":"mybirt=hday=E2=80=9D}'[/SHELL]Result:FormVariables
userinfo =3D {"userName":&q=uot;dim@witted.net&=quot;,"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 passw=ord=3Dmybirthday [/SHELL]on the test.html page:=div>FormVariables<br>[FormVariabl=es name=3D&exact=3DF][name] =3D [value]<br>[/FormVaria=bles]Note that I have declared each variabl=e =C2=A0as a separate -dThe -k means for curl to =ignore ssl errors.Make sure that your=C2=A0http://localhost/jso=n_auth.dna=C2=A0is able to deal with the WebDNA. On 25 Apr 2019, at 02:28, Michael D=avis <admin@net=work13.net> wrote:---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list talk@w=ebdna.usTo unsubscribe, E-mail to: talk-leave@webdna.usarchives: http://www.webdna.us/page.dna?numero=3D55Bug Reporting: suppo=rt@webdna.usStuart,
To avoid any br=owser specific issues, I'm writing the [formvariables] output to a file= and then opening the file with a text editor.
[WriteFile file=3D[c=art].txt][formvariables][name] =3D [value]
[/FormVariables][/WriteFile]<=br>
MD
April 23, 2019 11:04 PM, "Stuart Tremain" &l=t;webdna@plsoftware.com.au<=/a>> wrote:
Have you have a look at the source code of the re=sulting page ?------------------------------------------=--------------- This message is sent to you because you are subscribed to t=he 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=sSometimes, depending on the browser, it does= not display on the rendered page.
-----------------------------------------------=---------- This message is sent to you because you are subscribed to the ma=iling 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>
On 24 A=pr 2019, at 15:55, Michael Davis <admin@netw=ork13.net> wrote:Stuart,
Sorry, that was a typo/mistake on =my part. I was using [formvariables], not [listvariables]. Nothing in the r=esults. I've tested on FCGI and Server versions.
MD
<=br>April 23, 2019 6:44 PM, "Stuart Tremain" <webdna@plsoftware.com.au> wrote:---=------------------------------------------------------ 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.usTry =[FormVariables name=3D&exact=3DF][name] =3D [value]<br&g=t;[/FormVariables]ListVariables will only list TEXT vars etc. Kind regardsStuart Tremain Pharoah Lane Soft=wareAUS=TRALIA<=a rel=3D"external nofollow noopener noreferrer" href=3D"mailto:webdna@plsof=tware.com.au" target=3D"_blank">webdna@plsoftware.com.au<=div>=On 24 Apr 2019, at 11:03, Michael Davis <admin@network13.net> wrote:Hi All,------=--------------------------------------------------- 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.usI'm tryi=ng 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.dnaOn the receiving WebDNA template:[ListVariab=les][name]=3D[value][/ListVariables][listmimeheaders][name]=3D[=value][/ListMIMEHeaders]I get a =list of the usual MIME Headers, none include the JSON. LIstVariables return=s nothing.Any way to see this data in WebDNA?=MD
DOWNLOAD WEBDNA NOW!
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...