Posting to LiveCode Server

Mike Bonner bonnmike at gmail.com
Wed Apr 18 09:50:47 EDT 2018


Can you share the code to the page you're actually posting to?  Its
sounding like its not actually returning any output, causing a 500 internal
error.  Just to let you test, I set up a quick and dirty page at
http://guidezone.info/test.lc
The code in the page is as follows.

<?lc
put the keys of $_POST into tKeys
if tKeys is not empty then
   repeat for each line tKey in tKeys
      put $_POST[tkey] & "<br>"
   end repeat
else
   put "Error: No data posted" -- gotta put somethingto avoid a 500 error
end if
?>

To test it, I used the following in a button.
put "Accept: text/plain" & CR after tHeaders
put "Content-Type: application/x-www-form-urlencoded" & CR after tHeaders
set the httpHeaders to tHeaders

put liburlformdata("name","Chi","gender","male","color","black") into
tPostData

put tPostData & cr --so that I can see the generated post string

post tPostData to "http://guidezone.info/test.lc"

put it && the result after msg


This works for me, though as I said, I don't have tsnet.  You're welcome to
do test runs against my url if you like. If it works for me as written, and
not for you, i'd be pointing my finger at tsnet.

On Wed, Apr 18, 2018 at 7:01 AM, Alex Tweedly via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Not quite sure what you're trying to do ... or why you use such a
> complicated URL in the client code.
>
> Changing it to simply
>
> *get URL "https://api01.triviamatic.tv/round_create.lc"
> *
>
> will work fine, as will
>
> *post*emptyto"https://api01.triviamatic.tv/round_create.lc"
>
>
> -- Alex.
>
>
>
> On 18/04/2018 11:50, Todd Fabacher via use-livecode wrote:
>
>> Any Help will be appreciated...
>>
>> Normally we use Node.js, but we are trying to get LiveCode server working.
>> We are doing a simple test:
>>
>> <?lc put "It Works" ?>
>>
>>
>> If I put the URL in a browser I get back, "It works"
>>
>> https://api01.triviamatic.tv/round_create.lc
>> <https://www.google.com/url?q=https://api01.triviamatic.tv/r
>> ound_create.lc&sa=D&source=hangouts&ust=1524117219848000&usg
>> =AFQjCNFvW3yaTcJjQ9bGpWgi3CYh1mQwGA>
>>
>>
>> *put* "Accept: text/plain" & CR after tHeaders
>> *put* "Content-Type: application/x-www-form-urlencoded" & CR after
>> tHeaders
>> *set* the httpHeaders to tHeaders
>> *put*"fullname=chi&gender=male&color=black" into tArgList
>> *post* tArgList to URL "https://api01.triviamatic.tv/round_create.lc
>> <https://www.google.com/url?q=https://api01.triviamatic.tv/r
>> ound_create.lc&sa=D&source=hangouts&ust=1524117219848000&usg
>> =AFQjCNFvW3yaTcJjQ9bGpWgi3CYh1mQwGA>
>> "
>> *put* the result into tError
>> *put* it into tFormResults
>>
>>
>> The tError is:  tsneterr: (52) Empty reply from server
>>
>> and tFormResults is null
>>
>>
>> I need some help ASAP. This is SUPER frustrating!!
>>
>> --Todd Fabacher
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list