HTTP Post - XML URL Encoding

1.7k views Asked by At

I am trying to post some xml to a website api called vid.ly, a video hosting site. My lack of knowledge of HTTP Post and XML means I don't really know how to encode the XML for posting. The instructions are as follows

Vidly accepts XML requests sent on http://m.vid.ly/api/ URL via simple HTTP POST (please note, you should keep trailing slash in URL).

XML should be placed in xml POST parameter. In response Vidly sends XML as well. You can try it right away on the API test page: http://m.vid.ly/test/test_api.php.

The XML string I am trying to send, and I know works (although if you try it, the UserID has been changed for security) as I have tested it in their test box is

<?xml version="1.0"?>
<Query>
<Action>GetMediaList</Action>
<UserID>694</UserID>
<UserKey>434dd012aaa9ccbf48fa681b792bfagd</UserKey>
<Count>10</Count> <!-- optional -->
</Query>

I am trying to incorporate it into a program called filemaker but right now I would really love someone to show me how to get a response from any HTTP Post environment. If someone could show me how to get a response in 'www.Hurl.it' that would be incredibly helpful. All I ever get as a response is 'No XML present'.

Thanks

James

1

There are 1 answers

6
Jens Teich On

FileMaker supports HTTP Post in recent versions, at least 13 and 14. Limitation is only content-type x-www-formencoded. I'm not sure wether this is enough for this problem.

[Additional info:]

I tried it and it works with FileMaker. A script is required with this step:

Insert from URL [ Select ; <your-result-field> ; "httppost://manage.encoding.com" & "?xml=" & GetAsURLEncoded ( <your-xml> )]

[Not required because it is possible in FileMaker directly:]

In every case it is possible to do this with drakma, see http://weitz.de/drakma, Common Lisp library.

Toolset http://weitz.de/fm-plugin-tools/ allows to build filemaker plugins. It requires a licence of http://lispworks.com professional. This is possibly a bit much for this simple problem.

If you can solve this in PHP of Java, there are also plugins for FileMaker which support these languages.

~jens