From 4237630f98c2e799b7c7ee60b00b678091ecbd85 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 6 Feb 2021 18:54:18 +0300 Subject: [PATCH] export DefaultContentType Signed-off-by: Vasiliy Tolstov --- http.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 33065f3..0a80767 100644 --- a/http.go +++ b/http.go @@ -21,6 +21,10 @@ import ( "github.com/unistack-org/micro/v3/router" ) +var ( + DefaultContentType = "application/json" +) + func filterLabel(r []router.Route) []router.Route { // selector.FilterLabel("protocol", "http") return r @@ -521,7 +525,7 @@ func NewClient(opts ...client.Option) client.Client { options := client.NewOptions(opts...) if len(options.ContentType) == 0 { - options.ContentType = "application/json" + options.ContentType = DefaultContentType } rc := &httpClient{