M
M
Maxim Tkachev2018-04-09 16:41:44
PHP
Maxim Tkachev, 2018-04-09 16:41:44

Sending a PUT request. Service My warehouse. Why doesn't it update?

I need help from PHP developers.
I want to update hooks.
$uri=' https://online.moysklad.ru/api/remap/1.1/entity/we... ';
$data =
'{
"enabled": false
}';
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($curl, CURLINFO_HEADER_OUT, true);
curl_setopt($curl, CURLOPT_USERPWD, "$userName:$userPassword");
curl_setopt($curl, CURLOPT_URL, $uri);
curl_setopt($curl, CURLOPT_PUT, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($data)));
$response = curl_exec($curl);
The web hook does not change.
Where is the mistake?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question