Skip to content

Add body getter and support multipart/form-data enctype#3

Open
elquimista wants to merge 4 commits into
koa-modules:masterfrom
elquimista:master
Open

Add body getter and support multipart/form-data enctype#3
elquimista wants to merge 4 commits into
koa-modules:masterfrom
elquimista:master

Conversation

@elquimista

Copy link
Copy Markdown

This PR supports req.body getter. E.g. I was using jquery-ujs for an anchor tag with data-method="delete". Since jquery-ujs is originally designed for rails, it used form body to send hidden input field value with name of _method. And this obviously doesn't get passed query getter.

@coveralls

coveralls commented Dec 28, 2016

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 731ac2b on clthck:master into b1ca349 on koa-modules:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling daec4cd on clthck:master into b1ca349 on koa-modules:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling daec4cd on clthck:master into b1ca349 on koa-modules:master.

@elquimista elquimista force-pushed the master branch 2 times, most recently from d26cb35 to e53b5b9 Compare December 29, 2016 13:28
@elquimista elquimista changed the title Feat: add body getter Add body getter and support multipart/form-data enctype Dec 29, 2016
@fundon

fundon commented Jan 4, 2017

Copy link
Copy Markdown
Member

Is it better by an option?

@elquimista

Copy link
Copy Markdown
Author

I think this is improved version for sure. Original one can only handle situations where _method param comes in query string, not request body or multipart/formdata

@fundon

fundon commented Jan 4, 2017

Copy link
Copy Markdown
Member

I think we can use an option for enabling that.

@elquimista

Copy link
Copy Markdown
Author

@fundon what's your plan for this PR?

@fundon

fundon commented Mar 11, 2017

Copy link
Copy Markdown
Member

@clthck About an option?

@elquimista

Copy link
Copy Markdown
Author

I don't think providing this as an option is not appropriate. It's not something user wants to opt in/out - it should be handled by default. There's no difference in overhead or whatever if we make this feature optable.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants