Answer the question
In order to leave comments, you need to log in
How to pass a variable using the POST method?
CDEK's documentation says:
To use it, you need to send a POST request to the URL: <server>/new_orders.php, for example, https://integration.cdek.ru/new_orders.php with the $_POST['xml_request'] variable filled in, in which the contents of the XML file are transmitted.
DeliveryRequest
Number
Date
Account
Secure
OrderCount
https://integration.cdek.ru/new_orders.php?xml_request=(и что тут нужно указать?)
like or how?
Answer the question
In order to leave comments, you need to log in
Looks like this.
require 'net/http'
xml_file_content = File.read("xml_file.xml")
uri = URI('https://integration.cdek.ru/new_orders.php')
res = Net::HTTP.post_form(uri, 'xml_request': xml_file_content)
puts res.body
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question