Skip to content
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

Bind JSON and Query? #811

Closed
drpebcak opened this issue Feb 18, 2017 · 2 comments
Closed

Bind JSON and Query? #811

drpebcak opened this issue Feb 18, 2017 · 2 comments

Comments

@drpebcak
Copy link

Hey, I'm trying to bind both json data AND query params in the same request.. when I use c.Bind and c.BindJSON together, gin tries to return a 400.

c.Bind(&example)
c.BindJson(&example)

Is there a way to avoid that 400 message?

[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 400 with 200

@appleboy
Copy link
Member

duplicate of #742

@drpebcak
Copy link
Author

I'm not sure I understand how this is a duplicate?

#742 is an issue with the difference between c.Bind and c.BindJson... in this case I understand the difference, but I want to bind both json data AND query params in the same request. When I use both of these functions together, gin tries to print out a http 400 response code that I have to override.

It doesn't seem like I should have to override in order to do this.

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

No branches or pull requests

2 participants