Мучаюсь и не могу понять в чем ошибка уже более недели
private function curl($url, $params = [])
{
$curl = curl_init();
$headers = [
'accept: application/json',
'Authorization: ' . $this->tokenV2
];
if(count($params)) {
$headers[] = 'Content-Type: application/json';
curl_setopt($curl, CURLOPT_POST, true );
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));
}
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 300);
$response = curl_exec($curl);
$curlInfo = curl_getinfo($curl);
$responseBodyRaw = substr($response, $curlInfo['header_size']);
$responseBody = json_decode($responseBodyRaw, true);
if(json_last_error() !== JSON_ERROR_NONE) {
$responseBody = $responseBodyRaw;
}
unset($response, $responseBodyRaw);
curl_close($curl);
return $responseBody;
}
private function queryV25($url, $params)
{
return $this->curl($this->urlV2 . $url, $params);
}
public function getCards()
{
return $this->queryV25(
'card/list',
[
'id' => 1,
'jsonrpc' => '2.0',
'params' => [
'query' => [
'limit' => 1000,
'offset' => 0,
'total' => 0
],
'supplierID' => $this->supplierId
]
]
);
}
\"(.*)\"
, а \"([^"]*)\"
href="data:...
, и download="{имя файла}". верстка, которая сделанная по макету едет
const API_ADDRESS = 'https://otpravka-api.pochta.ru';
private function __construct($appToken, $userKey)
{
$this->headers = [
'Content-Type: application/json',
'Accept: application/json;charset=UTF-8',
'Authorization: AccessToken ' . $appToken,
'X-User-Authorization: Basic ' . $userKey
];
}
private function rawRequest($dataInUtf8, $url, $method = self::METHOD_POST)
{
$headers = $this->headers;
$ch = curl_init(self::API_ADDRESS . $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
if(count($dataInUtf8) > 0) {
$dataString = json_encode($dataInUtf8);
$headers[] = 'Content-Length: ' . strlen($dataString);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
return curl_exec($ch);
}
UPDATE ${DB_PREFIX}product SET oct_stickers =
IF(product_id = ${productId} AND option_id IN ('10101', '10063'), 'My text', '');
<a id="comment-12345">Тот коммент, до которого надо проскроллить</a>
Location: /#comment-12345
<img[^>]*>
<img[^>]*;base64,[^>]*>