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 Sun, 30th Nov 2019.
Project "CURLS post form values.xojo_binary_project"
FileTypes
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 = "https://www.monkeybreadsoftware.com/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 UntitledMenu5 = ""
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu4 = ""
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = ""
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:
- /CURL/CURLS Amazon S3 download
- /CURL/CURLS Amazon S3 pre-signed URL
- /CURL/CURLS LDAP Query
- /CURL/CURLS Low Level Sockets
- /CURL/CURLS pop3 email delete
- /CURL/CURLS post form values/CURLS post form values old
- /CURL/CURLS preemptive threaded upload
- /CURL/CURLS query
- /CURL/CURLS text download
- /CURL/CURLS upload to Web App/Web Upload Receiver
The items on this page are in the following plugins: MBS CURL Plugin.