Post XML document to URL

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Post XML document to URL

Post by jwbuzz » Thu May 13, 2010 3:52 pm

Anyone have example code that shows how to post an XML document to a URL?
Justin

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: Post XML document to URL

Post by jwbuzz » Thu May 13, 2010 4:05 pm

I found a command like the following... I'll give it a try.

Code: Select all

post data to URL destinationURL

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Post XML document to URL

Post by Mark » Thu May 13, 2010 4:06 pm

Hi Justin,

You need a script similar to the following:

Code: Select all

put "xml=" & url "binfile:~/documents/somefile.xml" into myData
post myData to URL "http://www.domain.com/whatever.cgi"
You may need to url encode the data:

Code: Select all

put url "binfile:~/documents/somefile.xml" into myData
put "xml=" & urlEncode(mydata) into myData
post myData to URL "http://www.domain.com/whatever.cgi"
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply