POST command question
Michael Doub
mikedoub at gmail.com
Sun Mar 30 14:11:19 EDT 2014
Is there anything different about using the post command on live code server as compared to a mac desktop? I am trying to send mail via postmark. On my server I have the following script:
<?lc
set the ErrorMode to "inline"
put "/home/ua875508/public_html/doub.com/lc/" into mainpath
put mainpath & "libJson.livecode" into jsonLib
put mainpath & "cbEngine.livecode" into cbEngine
start using jsonLib
start using cbengine
put ProcessMail ($_POST_RAW)
?>
I drop the stack cbEngine.livecode on my server after testing on the desktop. in this stack, I have a mouseup hander that calls the ProcessMail function with dummy data for easy debugging. Everything works as expected the desktop. The post command does it thing I get the expected response from postmark. When I move the stack to the server environment, the post command seems to do nothing and I get nothing returned at all.
Can anyone provider me with any guidance?
Thanks,
Mike
--http://developer.postmarkapp.com/developer-build.html For addtional API Information
function libPostmark_SendEmail pMessageJSON
get the keys of pMessageJSON
if it <> empty then
put arrayToJson(pMessageJSON) into outgoing
else
put pMessageJSON into outgoing
end if
set the httpHeaders to "Accept: application/json" & return \
& "Content-Type: application/json" & return \
& "X-Postmark-Server-Token: my token goes here"
post outgoing to URL "https://api.postmarkapp.com/email"
put jsonToArray(it) into theResults
if theResults["ErrorCode"] <> 0 then
return it
else
return true
end if
end libPostmark_SendEmail
More information about the use-livecode
mailing list