Skip to content

Formatter for: "content-type: application/json" #977

Description

@nowackipawel

I am trying to use CI4 for an API and I am sure that thing was working in some of previous versions.

My request header is:
content-type:
application/json

I am getting error:

<br /> <b>Fatal error</b>: Uncaught InvalidArgumentException: No Formatter defined for mime type: in /home/.../site/application/Config/Format.php:56 Stack trace: #0 /home/.../site/system/API/ResponseTrait.php(358): Config\Format-&gt;getFormatter('') #1 /home/.../site/system/API/ResponseTrait.php(120): CodeIgniter\Debug\Exceptions-&gt;format(Array) #2 /home/.../site/system/Debug/Exceptions.php(149): CodeIgniter\Debug\Exceptions-&gt;respond(Array, 500) #3 [internal function]: CodeIgniter\Debug\Exceptions-&gt;exceptionHandler(Object(Error)) #4 {main} thrown in <b>/home/.../site/application/Config/Format.php</b> on line <b>56</b><br /> <br /> <b>Fatal error</b>: Uncaught InvalidArgumentException: No Formatter defined for mime type: in /home/.../site/application/Config/Format.php:56 Stack trace: #0 /home/.../site/system/API/ResponseTrait.php(358): Config\Format-&gt;getFormatter('') #1 /home/.../site/system/API/ResponseTrait.php(120): CodeIgniter\Debug\Exceptions-&gt;format(Array) #2 /home/.../site/system/Debug/Exceptions.php(149): CodeIgniter\Debug\Exceptions-&gt;respond(Array, 500) #3 /home/.../site/system/Debug/Exceptions.php(201): CodeIgniter\Debug\Exceptions-&gt;exceptionHandler(Object(ErrorException)) #4 [internal function]: CodeIgniter\Debug\Exceptions-&gt;shutdownHandler() #5 {main} thrown in <b>/home/.../site/application/Config/Format.php</b> on line <b>56</b><br />

When I add an print $mime in this function it prints : undefined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions