Answer the question
In order to leave comments, you need to log in
How to send data using post method using curl?
You need to send a POST request to the URL https://integration.cdek.ru/new_orders.php with the xml_request variable filled in, in which the contents of the XML file are transmitted.
I do
curl -X POST https://integration.cdek.ru/new_orders.php -H 'Content-Type: multipart/form-data' -H 'Content-Type: application/x-www-form-urlencoded' \
-F 'xml_request=<?xml version="1.0" encoding="UTF-8"?>
<DeliveryRequest Number="236" Date="2010-10-14" Account="abc123" Secure="abcd1234" OrderCount="2">
<Order Number="5403" DeliveryRecipientCost="0" SendCityCode="270" RecCityCode="44" RecipientName="Васина Юлия Александровна" Phone="7810999, 9295849151" Comment="Офис группы компаний Ланит. При приезде позвонить на мобильный телефон." TariffTypeCode="5" RecientCurrency="RUB" ItemsCurrency="RUB">
<Address PvzCode="MSK2"></Address>
<Package Number="1" BarCode="101" Weight="630">
<Item WareKey="25000050368" Cost="49" Payment="49" Weight="68" Amount="1" Comment="Дидактические игры-занятия в ДОУ Ст.возраст Вып. 1"></Item>
</Package>
<AddService ServiceCode="30"></AddService>
<Schedule>
<Attempt ID="1" Date="2010-10-15" TimeBeg="09:00:00" TimeEnd="13:00:00" />
<Attempt ID="2" Date="2010-10-16" TimeBeg="14:00:00" TimeEnd="18:00:00" RecipientName="Прокопьев Анатолий Сергеевич" />
</Schedule>
</Order>
</DeliveryRequest>'
curl: (26) couldn't open file "?xml version="1.0" encoding="UTF-8"?>
<DeliveryRequest Number="236" Date="2010-10-14" Account="abc123" Secure="abcd1234" OrderCount="2">
<Order Number="5403" DeliveryRecipientCost="0" SendCityCode="270" RecCityCode="44" RecipientNa
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question