1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-23 22:05:15 +02:00
Files
OpenIntegrations/docs/en/examples/HTTPClient/UseMultipartFieldsAtOAuth.txt
Vitaly the Alpaca (bot) fee7490852 Main build (Jenkins)
2025-05-09 00:04:38 +03:00

23 lines
782 B
Plaintext
Vendored

URL = "https://httpbin.org";
URL = URL + "/post";
Image = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
Token = "***";
Secret = "***";
UsersKey = "***";
UsersSecret = "***";
Version = "1.0";
NewRequest = OPI_HTTPRequests.NewRequest().Initialize(URL);
Result = NewRequest
.StartMultipartBody()
.AddMultipartFormDataFile("file1", "pic.png", Image, "image/png")
.AddMultipartFormDataField("field1", "Text")
.AddMultipartFormDataField("field2", "10")
.UseMultipartFieldsAtOAuth(False) // <---
.AddOauthV1Authorization(Token, Secret, UsersKey, UsersSecret, Version)
.ProcessRequest("POST")
.ReturnResponseAsJSONObject();