var request = require('request');
var options = {
'method': 'POST',
'url': '127.0.0.100:8012/products.edit',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODI3OTM4NjksIm5iZiI6MTU4Mjc5Mzg3MCwiZXhwIjoxNTgyODI5ODY5LCJsb2dpbiI6ImFkbWluIn0.9OkTphxKP4OKh77Xa2dOE5OLiTmmW-Blor_6FK6aVUg'
},
body: JSON.stringify({"product_id":1,"name":"Чай","description":"Чай хана","price":100,"old_price":120,"image_id":1,"restaurant_id":1,"images":[2,3,4],"categories":[1],"recommendations":[7],"state":true,"lang":"ru"})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Note: for...in should not be used to iterate over an Array where the index order is important.
Индексы массива являются просто перечислимыми свойствами с целочисленными именами и в остальном идентичны общим свойствам объекта. Нет гарантии, что for ... in вернет индексы в любом конкретном порядке. Оператор цикла for ... in вернет все перечисляемые свойства, в том числе с нецелыми именами и наследуемыми.
Зачем оно в одной папке с симфони?
<?php
namespace App;
use Exception;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Exception\LoaderLoadException;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use function dirname;
/**
* Class ApiKernel
* @package App
*/
class ApiKernel extends BaseKernel
{
use MicroKernelTrait;
/** @var string */
private const CONFIG_EXTS = ".{php,xml,yaml,yml}";
/**
* @return iterable
*/
public function registerBundles(): iterable
{
$contents = require $this->getProjectDir() . "/config/api/bundles.php";
foreach ($contents as $class => $envs) {
if ($envs[$this->environment] ?? $envs["all"] ?? false) {
yield new $class();
}
}
}
/**
* @return string
*/
public function getProjectDir(): string
{
return ROOT_DIRECTORY;
}
/**
* @return string
*/
public function getCacheDir()
{
return ROOT_DIRECTORY . '/var/cache/api/' . $this->getEnvironment();
}
/**
* @return string
*/
public function getLogDir()
{
return ROOT_DIRECTORY . '/var/log/api';
}
/**
* @param ContainerBuilder $container
* @param LoaderInterface $loader
* @throws Exception
*/
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$container->addResource(new FileResource($this->getProjectDir().'/config/api/bundles.php'));
$container->setParameter('container.dumper.inline_class_loader', true);
$confDir = $this->getProjectDir().'/config/api';
$loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
}
/**
* @param RouteCollectionBuilder $routes
* @throws LoaderLoadException
*/
protected function configureRoutes(RouteCollectionBuilder $routes): void
{
$confDir = $this->getProjectDir() . "/config/api";
$routes->import($confDir . "/{routes}/" . $this->environment . "/**/*" . self::CONFIG_EXTS, "/", "glob");
$routes->import($confDir . "/{routes}/*" . self::CONFIG_EXTS, "/", "glob");
$routes->import($confDir . "/{routes}" . self::CONFIG_EXTS, "/", "glob");
}
}
Feb 21 19:21:29 mail postfix/smtpd[894]: error: open database /etc/postfix/vmailbox: No such file or directory
Feb 21 19:21:29 mail postfix/smtpd[894]: connect from mail.app.mail_default[172.23.0.3]
Feb 21 19:21:29 mail postfix/smtpd[894]: NOQUEUE: reject: RCPT from mail.app.mail_default[172.23.0.3]: 554 5.7.1 <igor.popryduhin@cn-expert.pro>: Relay access denied; from=<admin@domain.com> to=<igor.popryduhin@cn-expert.pro> proto=ESMTP helo=<localhost>
Feb 21 19:21:30 mail postfix/smtpd[894]: NOQUEUE: reject: RCPT from mail.app.mail_default[172.23.0.3]: 554 5.7.1 <igor.popryduhin@cn-expert.pro>: Relay access denied; from=<admin@domain.com> to=<igor.popryduhin@cn-expert.pro> proto=ESMTP helo=<localhost>
Feb 21 19:21:30 mail postfix/smtpd[894]: disconnect from mail.app.mail_default[172.23.0.3] ehlo=1 mail=1/3 rcpt=0/3 data=0/3 quit=1 commands=3/11
Feb 21 18:58:05 mail opendkim[95]: OpenDKIM Filter v2.11.0 starting (args: -f)
Feb 21 18:58:06 mail opendmarc[102]: OpenDMARC Filter v1.3.2 starting (args: -f -p inet:8893@localhost -P /var/run/opendmarc/opendmarc.pid)
Feb 21 18:58:06 mail opendmarc[102]: additional trusted authentication services: mail.dev.com
Feb 21 18:58:07 mail amavis[123]: starting. /usr/sbin/amavisd-new at mail.dev.com amavisd-new-2.10.1 (20141025), Unicode aware
Feb 21 18:58:07 mail amavis[123]: Net::Server: Group Not Defined. Defaulting to EGID '111 111'
Feb 21 18:58:07 mail amavis[123]: Net::Server: User Not Defined. Defaulting to EUID '109'
Feb 21 18:58:07 mail amavis[123]: Module Amavis::Conf 2.404
Feb 21 18:58:07 mail amavis[123]: Module Archive::Zip 1.59
Feb 21 18:58:07 mail amavis[123]: Module BerkeleyDB 0.55
Feb 21 18:58:07 mail amavis[123]: Module Compress::Raw::Zlib 2.069
Feb 21 18:58:07 mail amavis[123]: Module Compress::Zlib 2.069001
Feb 21 18:58:07 mail amavis[123]: Module Digest::MD5 2.54
Feb 21 18:58:07 mail amavis[123]: Module Encode 2.80_01
Feb 21 18:58:07 mail amavis[123]: Module File::Temp 0.2304
Feb 21 18:58:07 mail amavis[123]: Module IO::Socket::IP 0.37
Feb 21 18:58:07 mail amavis[123]: Module MIME::Entity 5.508
Feb 21 18:58:07 mail amavis[123]: Module MIME::Parser 5.508
Feb 21 18:58:07 mail amavis[123]: Module MIME::Tools 5.508
Feb 21 18:58:07 mail amavis[123]: Module Mail::Header 2.18
Feb 21 18:58:07 mail amavis[123]: Module Mail::Internet 2.18
Feb 21 18:58:07 mail amavis[123]: Module Net::LibIDN 0.12
Feb 21 18:58:07 mail amavis[123]: Module Net::Server 2.008
Feb 21 18:58:07 mail amavis[123]: Module Scalar::Util 1.4202
Feb 21 18:58:07 mail amavis[123]: Module Socket 2.020_03
Feb 21 18:58:07 mail amavis[123]: Module Time::HiRes 1.9733
Feb 21 18:58:07 mail amavis[123]: Module Unix::Syslog 1.1
Feb 21 18:58:07 mail amavis[123]: Amavis::ZMQ code NOT loaded
Feb 21 18:58:07 mail amavis[123]: Amavis::DB code loaded
Feb 21 18:58:07 mail amavis[123]: SQL base code NOT loaded
Feb 21 18:58:07 mail amavis[123]: SQL::Log code NOT loaded
Feb 21 18:58:07 mail amavis[123]: SQL::Quarantine NOT loaded
Feb 21 18:58:07 mail amavis[123]: Lookup::SQL code NOT loaded
Feb 21 18:58:07 mail amavis[123]: Lookup::LDAP code NOT loaded
Feb 21 18:58:07 mail amavis[123]: AM.PDP-in proto code loaded
Feb 21 18:58:07 mail amavis[123]: SMTP-in proto code loaded
Feb 21 18:58:07 mail amavis[123]: Courier proto code NOT loaded
Feb 21 18:58:07 mail amavis[123]: SMTP-out proto code loaded
Feb 21 18:58:07 mail amavis[123]: Pipe-out proto code NOT loaded
Feb 21 18:58:07 mail amavis[123]: BSMTP-out proto code NOT loaded
Feb 21 18:58:07 mail amavis[123]: Local-out proto code loaded
Feb 21 18:58:07 mail amavis[123]: OS_Fingerprint code NOT loaded
Feb 21 18:58:07 mail amavis[123]: ANTI-VIRUS code NOT loaded
Feb 21 18:58:07 mail amavis[123]: ANTI-SPAM code NOT loaded
Feb 21 18:58:07 mail amavis[123]: ANTI-SPAM-EXT code NOT loaded
Feb 21 18:58:07 mail amavis[123]: ANTI-SPAM-C code NOT loaded
Feb 21 18:58:07 mail amavis[123]: ANTI-SPAM-SA code NOT loaded
Feb 21 18:58:07 mail amavis[123]: Unpackers code loaded
Feb 21 18:58:07 mail amavis[123]: DKIM code NOT loaded
Feb 21 18:58:07 mail amavis[123]: Tools code NOT loaded
Feb 21 18:58:07 mail amavis[123]: Found $file at /usr/bin/file
Feb 21 18:58:07 mail amavis[123]: No $altermime, not using it
Feb 21 18:58:07 mail amavis[123]: Internal decoder for .mail
Feb 21 18:58:07 mail amavis[123]: Found decoder for .Z at /bin/uncompress
Feb 21 18:58:07 mail amavis[123]: Found decoder for .gz at /bin/gzip -d
Feb 21 18:58:07 mail amavis[123]: Found decoder for .bz2 at /bin/bzip2 -d
Feb 21 18:58:07 mail amavis[123]: Found decoder for .xz at /usr/bin/xz -dc
Feb 21 18:58:07 mail amavis[123]: Found decoder for .lzma at /usr/bin/xz -dc --format=lzma
Feb 21 18:58:07 mail amavis[123]: Found decoder for .lrz at /usr/bin/lrzip -q -k -d -o -
Feb 21 18:58:07 mail amavis[123]: Found decoder for .lzo at /usr/bin/lzop -d
Feb 21 18:58:07 mail amavis[123]: Found decoder for .lz4 at /usr/bin/lz4c -d
Feb 21 18:58:07 mail amavis[123]: Found decoder for .rpm at /usr/bin/rpm2cpio
Feb 21 18:58:07 mail amavis[123]: Found decoder for .cpio at /bin/pax
Feb 21 18:58:07 mail amavis[123]: Found decoder for .tar at /bin/pax
Feb 21 18:58:07 mail amavis[123]: Found decoder for .deb at /usr/bin/ar
Feb 21 18:58:07 mail amavis[123]: Found decoder for .rar at /usr/bin/unrar-free
Feb 21 18:58:07 mail amavis[123]: Found decoder for .arj at /usr/bin/arj
Feb 21 18:58:07 mail amavis[123]: Found decoder for .arc at /usr/bin/nomarch
Feb 21 18:58:07 mail amavis[123]: Found decoder for .zoo at /usr/bin/zoo
Feb 21 18:58:07 mail amavis[123]: Found decoder for .doc at /usr/bin/ripole
Feb 21 18:58:07 mail amavis[123]: Found decoder for .cab at /usr/bin/cabextract
Feb 21 18:58:07 mail amavis[123]: Internal decoder for .tnef
Feb 21 18:58:07 mail amavis[123]: Found decoder for .zip at /usr/bin/7za
Feb 21 18:58:07 mail amavis[123]: Found decoder for .kmz at /usr/bin/7za
Feb 21 18:58:07 mail amavis[123]: Found decoder for .7z at /usr/bin/7zr
Feb 21 18:58:07 mail amavis[123]: Found decoder for .jar at /usr/bin/7z
Feb 21 18:58:07 mail amavis[123]: Found decoder for .swf at /usr/bin/7z
Feb 21 18:58:07 mail amavis[123]: Found decoder for .lha at /usr/bin/7z
Feb 21 18:58:07 mail amavis[123]: Found decoder for .iso at /usr/bin/7z
Feb 21 18:58:07 mail amavis[123]: Found decoder for .exe at /usr/bin/unrar-free; /usr/bin/arj
Feb 21 18:58:07 mail amavis[123]: No decoder for .F
Feb 21 18:58:07 mail amavis[123]: Deleting db files in /var/lib/amavis/db
Feb 21 18:58:07 mail amavis[123]: Creating db in /var/lib/amavis/db/; BerkeleyDB 0.55, libdb 5.3
Feb 21 18:58:09 mail postfix/master[859]: daemon started -- version 3.1.12, configuration /etc/postfix
Форк (англ. fork — развилка, вилка) или ответвление — использование кодовой базы программного проекта в качестве старта для другого, при этом основной проект может как продолжать существование, так и прекратить его. ... Дериватив является частным случаем форка и подразумевает именно подобное поведение.
Источник