request.payload on onRequest is always null #3424

Closed
Zuckonit opened this Issue Jan 11, 2017 · 2 comments

Projects

None yet

4 participants

@Zuckonit
Zuckonit commented Jan 11, 2017 edited

version: hapi 14.20

question:

request.payload on onRequest is always null

code:

    server.ext('onRequest', function(request, reply) {
        console.log(requeset.payload); //always null
    })

test:

curl -XPOST http://localhost:5601/hello -d "name=Paul2"

@sirgallifrey
Contributor

Payload has not yet been parsed at the time of onRequest. Have a look at this awesome cheatsheet

@Marsup Marsup added the non-issue label Jan 11, 2017
@Marsup Marsup self-assigned this Jan 11, 2017
@Marsup Marsup closed this Jan 11, 2017
@AdriVanHoudt
Member

Here is version 2 ;)

by the great @mtharrison

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