Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/CURL/CURLS post form values/CURLS post form values old
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 old
This example is the version from Fri, 23th Nov 2017.
Project "CURLS post form values old.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 TextField
ControlInstance Result Inherits TextField
End Control
Control HTMLViewer1 Inherits HTMLViewer
ControlInstance HTMLViewer1 Inherits HTMLViewer
End Control
Private Sub DoUpload() dim e as integer dim d as new UploadCURL d.OptionURL = "http://www.monkeybreadsoftware.de/filemaker/order.cgi" d.OptionVerbose = True d.CollectOutputData = true d.FormAdd(d.kFormCopyName,"firma", d.kFormCopyContents, "Test, Inc.") d.FormAdd(d.kFormCopyName,"name", d.kFormCopyContents, "Mr. Tester") d.FormAdd(d.kFormCopyName,"strasse", d.kFormCopyContents, "Average Road") d.FormAdd(d.kFormCopyName,"plz", d.kFormCopyContents, "12345") d.FormAdd(d.kFormCopyName,"ort", d.kFormCopyContents, "Nickenich") d.FormAdd(d.kFormCopyName,"land", d.kFormCopyContents, "The Test States") d.FormAdd(d.kFormCopyName,"telefon", d.kFormCopyContents, "555-555-555") d.FormAdd(d.kFormCopyName,"email", d.kFormCopyContents, "test@test.invalid") d.FormAdd(d.kFormCopyName,"comment", d.kFormCopyContents, "just a form test") d.FormFinish e=d.Perform ListBox1.AddRow "Result: "+str(e) ListBox1.AddRow d.GetInfoContentType Result.text = d.OutputData HTMLViewer1.LoadPage d.OutputData, nil 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 tutorial videos