热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

将Symfony从4.3更新到4.4后错误的内容类型

我已通过composer更新将Symfony项目(api平台)从4.3更新到4.4,但是现在我在POST请求中收到

我已通过composer更新将Symfony项目(api平台)从4.3更新到4.4,但是现在我在POST请求中收到此错误:


  

不支持内容类型“ application / json”。支持的MIME
  类型是“”。

断线的踪迹:


  

../ vendor / api-platform / core / src / EventListener / DeserializeListener.php

有什么主意吗?

编辑:

使用命令:

bin/console debug:config api_platform

我有这个api_platform.yaml

api_platform:
path_segment_name_generator: api_platform.path_segment_name_generator.dash
enable_fos_user: true
eager_loading:
force_eager: false
enabled: true
fetch_partial: false
max_joins: 30
oauth:
enabled: true
flow: password
tokenUrl: /api/login
clientId: ''
clientSecret: ''
type: oauth2
authorizationUrl: /oauth/v2/auth
scopes: { }
mapping:
paths:
- /var/www/srv/config/packages/apiplatform/user.yml
- /var/www/srv/config/packages/apiplatform/business.yml
- /var/www/srv/config/packages/apiplatform/service.yml
- /var/www/srv/config/packages/apiplatform/worker.yml
- /var/www/srv/src/Entity
title: ''
description: ''
version: 0.0.0
show_webby: true
default_operation_path_resolver: api_platform.operation_path_resolver.underscore
name_converter: null
allow_plain_identifiers: false
validator:
serialize_payload_fields: { }
enable_nelmio_api_doc: false
enable_swagger: true
enable_swagger_ui: true
enable_re_doc: true
enable_entrypoint: true
enable_docs: true
enable_profiler: true
collection:
exists_parameter_name: exists
order: ASC
order_parameter_name: order
pagination:
enabled: true
partial: false
client_enabled: false
client_items_per_page: false
client_partial: false
items_per_page: 30
maximum_items_per_page: null
page_parameter_name: page
enabled_parameter_name: pagination
items_per_page_parameter_name: itemsPerPage
partial_parameter_name: partial
resource_class_directories: { }
doctrine:
enabled: true
doctrine_mongodb_odm:
enabled: false
graphql:
enabled: false
default_ide: graphiql
graphiql:
enabled: false
graphql_playground:
enabled: false
nesting_separator: _
collection:
pagination:
enabled: true
swagger:
versions:
- 2
- 3
api_keys: { }
http_cache:
etag: true
max_age: null
shared_max_age: null
vary:
- accept
public: null
invalidation:
enabled: false
varnish_urls: { }
request_options: { }
mercure:
enabled: false
hub_url: null
messenger:
enabled: false
elasticsearch:
enabled: false
hosts: { }
mapping: { }
exception_to_status:
Symfony\Component\Serializer\Exception\ExceptionInterface: 400
ApiPlatform\Core\Exception\InvalidArgumentException: 400
ApiPlatform\Core\Exception\FilterValidationException: 400
Doctrine\ORM\OptimisticLockException: 409
formats:
jsonld:
mime_types:
- application/ld+json
json:
mime_types:
- application/json
html:
mime_types:
- text/html
patch_formats: { }
error_formats:
jsonproblem:
mime_types:
- application/problem+json
jsonld:
mime_types:
- application/ld+json





推荐阅读
author-avatar
手机用户2502933647
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有