Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/CURL/CURLS post form values/CURLS post form values
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 post form values/CURLS post form values
This example is the version from Wed, 30th Jan 2018.
Project "CURLS post form values.rbp"
Filetype text
Filetype all
End FileTypes
Class Window1 Inherits Window
Control ListBox1 Inherits ListBox
ControlInstance ListBox1 Inherits ListBox
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() DoUpload End EventHandler
End Control
Control Result Inherits TextArea
ControlInstance Result Inherits TextArea
End Control
Private Sub DoUpload() dim e as integer dim d as new UploadCURL d.OptionURL = "http://www.monkeybreadsoftware.de/filemaker/echo.cgi" d.OptionVerbose = True d.CollectOutputData = true d.FormAddField("firma", "Test, Inc.") d.FormAddField("name", "Mr. Tester") d.FormAddField("strasse", "Average Road") d.FormAddField("plz", "12345") d.FormAddField("ort", "Nickenich") d.FormAddField("land", "The Test States") d.FormAddField("telefon", "555-555-555") d.FormAddField("email", "test@test.invalid") d.FormAddField("comment", "just a form test") d.FormAddField("empty", "") d.FormAddField("TextWithEncoding", "just a form test", "text/plain") d.FormAddFile("FileAttachment", "test.txt", "just a form test", "text/plain") d.FormFinish e=d.Perform ListBox1.AddRow "Result: "+str(e) ListBox1.AddRow d.GetInfoContentType Result.text = ReplaceLineEndings(d.OutputData,EndOfLine) End Sub
End Class
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 UploadCURL Inherits CURLSMBS
EventHandler Sub DebugMessage(infotype as integer, data as string, dataSize as Integer) System.DebugLog str(infotype) System.DebugLog data End EventHandler
EventHandler Function Progress(dltotal as Int64, dlnow as Int64, ultotal as Int64, ulnow as Int64, percent as double) As boolean if ultotal=0 then window1.ListBox1.AddRow "Uploading..." else window1.ListBox1.AddRow "Uploading "+Format(ulnow/ultotal,"0%") end if End EventHandler
Sub Constructor() End Sub
End Class
End Project

See also:

Feedback, Comments & Corrections

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

MBS Xojo Plugins