1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-25 22:12:29 +02:00
Files
OpenIntegrations/docs/en/examples/HTTPClient/AddMultipartFormDataFile.txt

14 lines
498 B
Plaintext
Raw Normal View History

2025-10-20 19:41:52 +03:00
 URL = FunctionParameters["HTTP_URL"];
2025-04-25 21:52:05 +03:00
URL = URL + "/post";
2025-10-20 19:41:52 +03:00
Image = FunctionParameters["Picture"]; // URL, Path or Binary Data
2025-04-25 21:52:05 +03:00
Result = OPI_HTTPRequests.NewRequest()
.Initialize(URL)
.StartMultipartBody()
.AddMultipartFormDataFile("file1", "pic.png", Image, "image/png") // <---
.AddMultipartFormDataField("Field1", "Text")
.AddMultipartFormDataField("Field2", "10")
.ProcessRequest("POST")
.ReturnResponseAsJSONObject();