Send from 1C a POST request with the xml file?

There is a link to a resource, for example: info.eks.com/eservice.aspx?username=123456789, to which you want to send a POST request.
Written procedure:
ServerName = "info.eks.com";
HTTP = New Ntrauterine(Servername);

// Get a temporary file to send in the POST body of the request
Villasobroso = Poluchitekonomiyu();

Objecttypes = New ЗаписьXML;
Objecttypes.Otkrytiye(Of Villasobroso);
Objecttypes.ЗаписатьОбъявлениеXML();

Objecttypes.Zamestnanosti("xml");

Objecttypes.Zamestnanosti("info");

Objecttypes.Zamestnanosti("requestType");
Objecttypes.Zamestitel("1");
Objecttypes.Sepiatoneimage();

Objecttypes.Sepiatoneimage();

Objecttypes.Zamestnanosti("request");

Objecttypes.Zamestnanosti("inn");
Objecttypes.Zamestitel("078596354");
Objecttypes.Sepiatoneimage();

Objecttypes.Sepiatoneimage();

Objecttypes.Sepiatoneimage();

Objecttypes.Close();
//
// Get a temporary file — the response body of the POST request
Valresultat = Poluchitekonomiyu();


// Send a POST request to processing.

Username = "123456789";

Ntriples = New Ntriples("/eservice.aspx");
Ntriples.Ustroitelstva("?username=" + Username);
Ntriples.Ustanawiajaca(Of Villasobroso);

Result = HTTP.Otpravitsya(Ntriples,Valresultat);

But for some reason that doesn't work, I could be wrong?
March 23rd 20 at 18:43
1 answer
March 23rd 20 at 18:45
To debug the interaction with external servers, I recommend to use tools like Fiddler (article on Habre) - so you'll be able to check the package, which is formed and sent, as well as the whole server's response (headers and body).

And you know that the files are not necessary? If you make Ostanovitsja() to ЗаписьXML, closing it will return the result string. Further to set the body of the HTTP request using Ustroitelstva(). And if you do not specify the second parameter the function of Otpravitsya () it will return Ntrate from which you can read all the necessary information.

Find more questions by tags 1C-Enterprise