-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using paraType body/form #18
Comments
Can you provide your definition for the param? Also relevant code?
|
For example, this works for me:
$ curl --data "hello world" -H "Content-Type:text/plain" <url> |
See also #19 . Try running: |
Providing an empty value causes express to assign it as an object. The bug, if there is one, is in express: https://github.com/expressjs/body-parser/blob/master/lib/types/text.js#L51 |
yup, see also my issue logged there (expressjs/body-parser#44) and their response. Hence #19 to turn {} into an empty string. |
Can you post the full verbose output from |
output with
output with
app.coffee:
api/index.coffee:
api/handlers.coffee:
api/spec.yaml:
|
Thanks. Looks like the issue is actually deep down within the |
FYI I filed an issue as jshttp/type-is#9 to remind myself about this, and then expressjs/body-parser#44 will track when it makes it's way into body-parser module. |
Fixed in 1.0.0-rc.4 |
Thanks @dougwilson ! |
Just wanted to post an update on here that |
Awesome, thanks! |
We were stung by this (meaning, empty body being an empty plain object) at some point recently in one of the kraken modules. I recall we put in place some sort of workaround. Anyone remember where that was? I can (and will) dig around a bit but wanted to see if anyone knew off the top of their head before I did. |
can you provide some examples using paramType body and form, pref in combination with express 4?
re the body I can get some to work:
app.use(bodyParser.text())
curl <url> -v -d "" -H 'Content-Type: text/plain' -X POST
the form is where I fail to get it working...
The text was updated successfully, but these errors were encountered: