luceos Thank you for giving time. I finally found why it was happening. I removed .vnd.api+ keeping $headers['content-type'] = 'application/json' solved the issue.
# /vendor/flarum/core/src/Api/JsonApiResponse.php
class JsonApiResponse extends JsonResponse
{
/**
* {@inheritdoc}
*/
public function __construct(Document $document, $status = 200, array $headers = [], $encodingOptions = 15)
{
# I removed 'vnd.api+' from content type and it worked.
//$headers['content-type'] = 'application/vnd.api+json';
$headers['content-type'] = 'application/json';
// The call to jsonSerialize prevents rare issues with json_encode() failing with a
// syntax error even though Document implements the JsonSerializable interface.
// See https://github.com/flarum/core/issues/685
parent::__construct($document->jsonSerialize(), $status, $headers, $encodingOptions);
}
}