Giter Site home page Giter Site logo

Comments (3)

joeconwaystk avatar joeconwaystk commented on May 2, 2024
  1. Are you using HTTPController? HTTPController decodes the body as part of its processing, so by the time you get your responder method invoked, requestBodyObject is already valid.
  2. Are you testing in IntelliJ IDEA? It sometimes doesn't pick up standard output, which is really a pain. Running tests from the terminal (pub run test -j 1) is what I do when it fails to pick up stdout. It's really obnoxious when you want to see the stack trace of the server itself, which is often. There is a flag on RequestController for this purpose, includeErrorDetailsInServerErrorResponses, which if true, returns the stack trace of a 500 in the JSON body.

from aqueduct.

kbirch avatar kbirch commented on May 2, 2024

Okay awesome, thank you. Re: item 1... Yes to HTTPController, and originally I had included the decode call as per the code comment and in the absence of other examples I could find:

 /// The request body object, as determined by how it was decoded.
 ///
 /// This value will be null until [decodeBody] is executed or if there is no request body.

But I see now that it is already called inside of your HTTPController code, cool - simplifies things nicely.

On item 2, command line does what I need, thank you. I had seen this issue in browser-based projects before but not backend projects to this point, probably should have played around a bit more before flagging it - thanks for bearing with me. And the flag on RequestController is super helpful - just tried it, works well.

All done here :) Thanks again.

from aqueduct.

joeconwaystk avatar joeconwaystk commented on May 2, 2024

Btw, another reason HTTPController decodes the body for you (if and only if it plans to process the request) is because x-www-form-urlencoded data gets treated as query values for @HTTPQuery parameters, and so the body needs to be parsed prior to executing the responder method.

I also realized you just brought up an important point: we really need a forum for Aqueduct. We'll get working on that. Closing this issue.

from aqueduct.

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.