Answer the question
In order to leave comments, you need to log in
How to make a POST request from 1C?
Good day!
I apologize right away, I personally have nothing to do with 1C, and I don’t know about the possibilities of the language / platform / configuration either.
In an attempt to google the answer to my question, I could not get something suitable.
I am making a small server application (nodeJS), I am waiting for 3 files by one of the endpoints.
All these three files will be sent from 1Ski, the script for this is being developed by another person.
From his side, there are proposals to send one file per request. There is no other implementation. I don't really like this approach.
Can 1C send POST multipart/form-data with multiple files?
By means of Insomnia generated in python and cURL
import requests
url = "http://127.0.0.1:5000/api"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"s\"; filename=\"mockS.json\"\r\nContent-Type: application/json\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"u\"; filename=\"mockU.json\"\r\nContent-Type: application/json\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"r\"; filename=\"mockR.json\"\r\nContent-Type: application/json\r\n\r\n\r\n-----011000010111000001101001--\r\n"
headers = {"Content-Type": "multipart/form-data; boundary=---011000010111000001101001"}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
curl --request POST \
--url http://127.0.0.1:5000/api/
--header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
--form [email protected]/home/mockS.json \
--form [email protected]/home/mockU.json \
--form [email protected]/home/mockR.json
Answer the question
In order to leave comments, you need to log in
I recommend this module: https://github.com/vbondarevsky/Connector there, in the description, there is even sending several files
I recommend this article . They suggest using the Connector-HTTP library. The description contains an example for your situation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question