M
M
mihailsmirnov2015-09-11 19:53:35
PHP
mihailsmirnov, 2015-09-11 19:53:35

Request method when working with CNC Bitrix?

Good day!
I suffer with Bitrix.
It is required on a certain page of the site to receive data that is transmitted by the PUT and DELETE methods.
The site is CNC enabled.
the path to the script is /blog/api.php
according to the TK, the address /blog/posts/ is specified, the
problem is that if you transfer data simply to the script, then the request comes in the form in which it is transmitted, that is, for example, the PUT method.
But when you prescribe a url from the CNC, the data comes, but the method can no longer be determined which one, because GET always comes.
How can this problem be overcome?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Samokhvalov, 2015-09-13
@mihailsmirnov

You can determine by which method the script is accessed using the context:

use Bitrix\Main\Context;

$request = Context::getCurrent()->getRequest();
$method = $request->getRequestMethod();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question