Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to CURL Options translate to Plugin Calls?
Answer: Below a few tips on how to translate command line CURL calls to plugin calls.
Notes:
curl -vX PUT http://localhost:5984/appserials/78569238475/DocumentRegister.docx?rev=3-25634563456 --data-binary @DocumentRegister.docx -H "Content-Type: application/msword"

  • The option -v means verbose. You can use OptionVerbose and listen for messages in the DebugMessage event.
  • The option -X PUT means we want to do a HTTP PUT Request. So set OptionPut to true. Also you will want to set OptionUpload to true as you upload data.
  • We have the URL which you put into OptionURL property.
  • The --data-binary option tells CURL to pass the given data. With the @ before the data, it is intrepreted as a file name, so the data is read from the given file. You'll need to open this file and pass data with the Read event as needed. (See CURLS ftp file upload example project)
  • The last option -H specifies an additional header for the upload. Pas this additional header with the SetOptionHTTPHeader method.

curl -X PUT http://127.0.0.1:5984/appserials/f2f4e540bf8bb60f61cfcd4328001c59 -d '{"type":"Product","description":"Application Serial","acronym":"AppSerial","dateAdded":"2011-03-21 14:57:36"}'

  • Option -X PUT like above.
  • Pass the URL again in OptionURL
  • This time data is passed in command line for CURL. You'd put this data in the quotes into a string and make it available in the Read event. (See CURLS ftp upload example project)

Feedback, Comments & Corrections




Links
MBS Xojo Plugins