Closed lysu closed 7 years ago
Hi, I want to use strict.Accept to build versioned api base on HTTP Accept Header..
like heroku one https://github.com/interagent/http-api-design#require-versioning-in-the-accepts-header
but after trying found it doesn't work
m.Post("/zoo", strict.Accept("application/vnd.company+json; version=1"), func(n strict.Negotiator, r render.Render) { r.JSON(200, struct { S bool }{true}) }) m.Post("/zoo", strict.Accept("application/vnd.company+json; version=2"), func(n strict.Negotiator, r render.Render) { r.JSON(200, struct { R bool }{true}) })
version=1 accepted...but version=2 406 Not Acceptable...
version=1
version=2
I think it's a common requirement to mapping handler base on MIMETypes to make them both worked.
MIMETypes
Hi, I want to use strict.Accept to build versioned api base on HTTP Accept Header..
like heroku one https://github.com/interagent/http-api-design#require-versioning-in-the-accepts-header
but after trying found it doesn't work
version=1
accepted...butversion=2
406 Not Acceptable...I think it's a common requirement to mapping handler base on
MIMETypes
to make them both worked.