# ContentUri

URL: https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/
Проверено на 1С-Битрикс 25.x, обновлено 03.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией 1С-Битрикс.

Класс `\Bitrix\Main\Engine\Response\DataType\ContentUri`
Модуль: Main.

## Описание

Он даёт возможность обработать uri некоторым rest-приложением без каких-либо bearer-токенов.
Так, модуль "rest" преобразует ContentUri в два элемента. Один из них — оригинальный uri, а
второй — машинный uri.

Исходный файл: `source/main/lib/engine/response/datatype/contenturi.php:15`

## Методы (37)

- [`__construct()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/__construct/)
- [`__toString()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/__tostring/)
- [`addParams()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/addparams/) — Добавляет параметры в запрос или заменяет существующие.
- [`convertToPunycode()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/converttopunycode/) — Преобразует хост в punycode.
- [`convertToUnicode()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/converttounicode/) — Преобразует хост в Unicode.
- [`deleteParams()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/deleteparams/) — Удаляет параметры из запроса.
- [`getAuthority()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getauthority/)
- [`getFragment()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getfragment/)
- [`getHost()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/gethost/)
- [`getLocator()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getlocator/) — Возвращает URI без фрагмента.
- [`getPass()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getpass/) — Возвращает пароль, закодированный через rawurlencode.
- [`getPath()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getpath/)
- [`getPathQuery()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getpathquery/) — Возвращает путь с запросом. Пустой путь трактуется как корень (/).
- [`getPort()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getport/)
- [`getQuery()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getquery/)
- [`getScheme()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getscheme/)
- [`getUri()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/geturi/) — Возвращает URI с фрагментом, если он есть.
- [`getUrl()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/geturl/) (устаревший)
- [`getUser()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getuser/) — Возвращает пользователя, закодированного через rawurlencode.
- [`getUserInfo()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/getuserinfo/)
- [`isPathTraversal()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/ispathtraversal/) — Ищет /../ и urlencoded /../
- [`jsonSerialize()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/jsonserialize/) — Определяет данные, которые должны быть сериализованы в JSON.
- [`resolveRelativeUri()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/resolverelativeuri/) — Преобразует относительный URI в абсолютный в контексте базового URI.
- [`setHost()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/sethost/) — Устанавливает хост.
- [`setPass()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/setpass/) — Декодирует и устанавливает пароль.
- [`setPath()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/setpath/) — Устанавливает путь.
- [`setUser()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/setuser/) — Декодирует и устанавливает пользователя.
- [`toAbsolute()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/toabsolute/) — Преобразует относительный uri в абсолютный, используя заданное имя хоста или хост из объекта server текущего контекста.
- [`static urnDecode()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/urndecode/) — Декодирует строку URI без её парсинга.
- [`static urnEncode()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/urnencode/) — Кодирует строку URI без её парсинга.
- [`withFragment()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/withfragment/)
- [`withHost()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/withhost/)
- [`withPath()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/withpath/)
- [`withPort()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/withport/)
- [`withQuery()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/withquery/)
- [`withScheme()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/withscheme/)
- [`withUserInfo()`](https://chugunov.pro/api-bitrix/main/engine/response/datatype/contenturi/withuserinfo/)

Оригинал в официальной документации: https://docs.1c-bitrix.ru/api/classes/Bitrix-Main-Engine-Response-DataType-ContentUri.html
