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

Negotiate need support more format #2157

Closed
578559967 opened this issue Nov 27, 2019 · 0 comments
Closed

Negotiate need support more format #2157

578559967 opened this issue Nov 27, 2019 · 0 comments

Comments

@578559967
Copy link

Description

Negotiate function only support XML/HTML/JSON,but I need it to support YAML/Protobuf.
I think it should match the binding.Default:

gin/binding/binding.go

Lines 86 to 107 in 231ff00

func Default(method, contentType string) Binding {
if method == "GET" {
return Form
}
switch contentType {
case MIMEJSON:
return JSON
case MIMEXML, MIMEXML2:
return XML
case MIMEPROTOBUF:
return ProtoBuf
case MIMEMSGPACK, MIMEMSGPACK2:
return MsgPack
case MIMEYAML:
return YAML
case MIMEMultipartPOSTForm:
return FormMultipart
default: // case MIMEPOSTForm:
return Form
}
}

@ghost ghost mentioned this issue Jan 23, 2020
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