Skip to content

Custom success and error content-types in chi wrapper mode #115

Answered by vearutop
pboguslawski asked this question in Q&A
Discussion options

You must be logged in to vote

It is possible to do for SuccessfulResponseContentType, but there is no control yet for error content type.

// Router mode.
	r := chirouter.NewWrapper(chi.NewRouter())
	r.Method(http.MethodPost, "/foo", nethttp.SuccessfulResponseContentType(fooUsecase(),"foo/bar")))

// Same with web.Service.
	s := web.DefaultService()
	s.Post("/foo", fooUsecase(), nethttp.SuccessfulResponseContentType("foo/bar"))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pboguslawski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants