D
D
ddgryaz2021-10-01 13:43:28
1C
ddgryaz, 2021-10-01 13:43:28

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

python

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

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


insomnia

6156e43f502a9240687536.png


Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Anton, 2021-10-01
@ddgryaz

I recommend this module: https://github.com/vbondarevsky/Connector there, in the description, there is even sending several files

K
Konstantin Nagibovich, 2021-10-01
@nki

I recommend this article . They suggest using the Connector-HTTP library. The description contains an example for your situation.

S
Sgr_A, 2021-10-01
@Sgr_A

If your developer has access to ITS, he can look here and here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question