Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/CURL/CURLS get and put/CURLS get and put
Function:
Required plugins for this example: MBS CURL Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/CURLS get and put/CURLS get and put
This example is the version from Wed, 14th Jul 2015.
Project "CURLS get and put.rbp"
FileTypes
Filetype text
End FileTypes
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
Class MainWindow Inherits Window
Control fruits Inherits TextField
ControlInstance fruits Inherits TextField
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control Quantity Inherits TextField
ControlInstance Quantity Inherits TextField
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control TypeButton Inherits RadioButton
ControlInstance TypeButton(0) Inherits RadioButton
ControlInstance TypeButton(1) Inherits RadioButton
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() if TypeButton(1).Value then runGet else runPut end if End EventHandler
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Sub runGet() // this example sends a xml request to a server dim c as new CURLSMBS c.OptionVerbose=true c.OptionURL = "http://www.monkeybreadsoftware.de/cgi-bin/puttest.php?fruit="+fruits.text+"&quantity="+Quantity.text c.CollectDebugData = True c.CollectOutputData = true title=str(c.Perform) StaticText3.text=ReplaceLineEndings(c.OutputData,EndOfLine) End Sub
Sub runPut() dim header(-1) as string // this example sends a xml request to a server dim c as new CURLSMBS c.OptionVerbose=true c.OptionUpload=true c.OptionPut=true c.CollectDebugData = True c.CollectOutputData = true dim d as string = "fruit="+fruits.text+"&quantity="+Quantity.text c.inputdata=d c.OptionInFileSize=lenb(d) c.OptionURL = "http://www.monkeybreadsoftware.de/cgi-bin/puttest.php" title=str(c.Perform) StaticText3.text=ReplaceLineEndings(c.OutputData,EndOfLine) End Sub
End Class
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS CURL Plugin.




Links
MBS Xojo tutorial videos