GithubHelp home page GithubHelp logo

Comments (6)

wolfy-j avatar wolfy-j commented on August 22, 2024

Have you checked the https://spiral.dev/docs/http-configuration#middleware

Specifically Spiral\Bootloader\Http\JsonPayloadsBootloader. Sounds like we might need to enable it by the default.

from app.

wolfy-j avatar wolfy-j commented on August 22, 2024

Also, the documentation includes a full-text search, it will guide you to the proper article. Let me know how we can improve it.

from app.

lucasantarella avatar lucasantarella commented on August 22, 2024

Thanks for the help. I found it. It definetely doesn't work as I expected, though. Without enabling it, the actual PSR7 request interface has an empty body. Usually this would be the string request data, but its empty.

Using the JSON bootloader makes the input manager work, but the raw request should always contain the request payload, IMO.

This could use its own section in the documentation, or at least make it a sub section under the response. I would be happy to help add it as I become more familiar with its workings.

from app.

wolfy-j avatar wolfy-j commented on August 22, 2024

Using the JSON bootloader makes the input manager work, but the raw request should always contain the request payload, IMO.

This is weird since we have a proper test for it: https://github.com/spiral/roadrunner/blob/master/tests/http/payload.php

Is it possible that the content is in the request but you must reset the body position (seek)? Have you tried to convert it into the string? The body must be in the request if the middleware can parse it.

This could use its own section in the documentation, or at least make it a sub-section under the response. I would be happy to help add it as I become more familiar with its workings.

We are currently working on completing the documentation and announcing the platform. Any help with the documentation will be appreciated as we have to cover a massive amount of information.

from app.

wolfy-j avatar wolfy-j commented on August 22, 2024

How are you trying to read the raw body? Check how middleware doing it: https://github.com/spiral/framework/blob/master/src/Http/Middleware/JsonPayloadMiddleware.php#L47

I have a strong feeling that Nyholm getContents() and __toString() methods behave differently.

from app.

wolfy-j avatar wolfy-j commented on August 22, 2024

App build includes this middleware by default now.

from app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.