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

🚀 [Feature]: Support for application/problem+json #2701

Closed
3 tasks done
arielsrv opened this issue Nov 3, 2023 · 1 comment · Fixed by #2704
Closed
3 tasks done

🚀 [Feature]: Support for application/problem+json #2701

arielsrv opened this issue Nov 3, 2023 · 1 comment · Fixed by #2704

Comments

@arielsrv
Copy link

arielsrv commented Nov 3, 2023

Feature Description

Helpers should have support for application/problem+json RFC7807

const (
	MIMETextXML                = "text/xml"
	MIMETextHTML               = "text/html"
	MIMETextPlain              = "text/plain"
	MIMETextJavaScript         = "text/javascript"
	MIMEApplicationXML         = "application/xml"
	MIMEApplicationJSON        = "application/json"
        // New!
	MIMEApplicationProblemJSON = "application/problem+json" 
	// Deprecated: use MIMETextJavaScript instead
	MIMEApplicationJavaScript = "application/javascript"
	MIMEApplicationForm       = "application/x-www-form-urlencoded"
	MIMEOctetStream           = "application/octet-stream"
	MIMEMultipartForm         = "multipart/form-data"

	MIMETextXMLCharsetUTF8                = "text/xml; charset=utf-8"
	MIMETextHTMLCharsetUTF8               = "text/html; charset=utf-8"
	MIMETextPlainCharsetUTF8              = "text/plain; charset=utf-8"
	MIMETextJavaScriptCharsetUTF8         = "text/javascript; charset=utf-8"
	MIMEApplicationXMLCharsetUTF8         = "application/xml; charset=utf-8"
	MIMEApplicationJSONCharsetUTF8        = "application/json; charset=utf-8"
	// New!
        MIMEApplicationProblemJSONCharsetUTF8 = "application/problem+json; charset=utf-8"
	// Deprecated: use MIMETextJavaScriptCharsetUTF8 instead
	MIMEApplicationJavaScriptCharsetUTF8 = "application/javascript; charset=utf-8"
)

Additional Context (optional)

No response

Code Snippet (optional)

package main

import "github.com/gofiber/fiber/v2"
import "log"

func main() {
  app := fiber.New()

  // An example to describe the feature

  log.Fatal(app.Listen(":3000"))
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.
Copy link

welcome bot commented Nov 3, 2023

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

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

Successfully merging a pull request may close this issue.

2 participants