Repository: go-resty/resty (go)

Issue:
Implement easier adding of multi-value http headers
There are currently 2 `SetHeaders` functions with the following types:

```
func(headers map[string]string) *resty.Request
func(header string, value string) *resty.Request
```

It might be convenient to add a 3rd:

```
func(headers map[string][]string) *resty.Request
```

As listed in RFC2616 HTTP headers can have multiple values: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

This would also be convenient as the inbuilt golang `http.Header` type is defined as `map[string][]string` so would allow for direct usage of that type:

```golang
headers := http.Header{}
restyClient.R().SetHeaders(headers)
```


Pull request description:
feat(#432): Implement Easier Adding of Multiple Value HTTP Header
Implement easier adding of multiple value HTTP Header with function `SetMultiValueHeaders`

Closes #432

Patch:
diff --git a/.travis.yml b/.travis.yml
index 583a039..9b4aa53 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,8 +3,8 @@ language: go
 os: linux
 
 go: # use travis ci resource effectively, keep always latest 2 versions and tip :) 
+  - 1.16.x
   - 1.15.x
-  - 1.14.x
   - tip
 
 install:
diff --git a/README.md b/README.md
index 819fbf3..24da968 100644
--- a/README.md
+++ b/README.md
@@ -107,7 +107,7 @@ Resty author also published following projects for Go Community.
 
 ```bash
 # Go Modules
-require github.com/go-resty/resty/v2 v2.4.0
+require github.com/go-resty/resty/v2 v2.6.0
 ```
 
 ## Usage
@@ -876,7 +876,7 @@ BTW, I'd like to know what you think about `Resty`. Kindly open an issue or send
 
 ## Core Team
 
-Have a look on [Members](https://github.com/orgs/go-resty/teams/core/members) page.
+Have a look on [Members](https://github.com/orgs/go-resty/people) page.
 
 ## Contributors
 
diff --git a/request.go b/request.go
index 41709cf..b9d0184 100644
--- a/request.go
+++ b/request.go
@@ -117,6 +117,22 @@ func (r *Request) SetHeaders(headers map[string]string) *Request {
 	return r
 }
 
+// SetHeaderMultiValues sets multiple headers fields and its values is list of strings at one go in the current request.
+//
+// For Example: To set `Accept` as `text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8`
+//
+// 		client.R().
+//			SetHeaderMultiValues(map[string][]string{
+//				"Accept": []string{"text/html", "application/xhtml+xml", "application/xml;q=0.9", "image/webp", "*/*;q=0.8"},
+//			})
+// Also you can override header value, which was set at client instance level.
+func (r *Request) SetHeaderMultiValues(headers map[string][]string) *Request {
+	for key, values := range headers {
+		r.SetHeader(key, strings.Join(values, ", "))
+	}
+	return r
+}
+
 // SetHeaderVerbatim method is to set a single header field and its value verbatim in the current request.
 //
 // For Example: To set `all_lowercase` and `UPPERCASE` as `available`.


Test patch:
diff --git a/request_test.go b/request_test.go
index 368463a..e0b6065 100644
--- a/request_test.go
+++ b/request_test.go
@@ -1371,6 +1371,19 @@ func TestSetHeaderVerbatim(t *testing.T) {
 	assertEqual(t, "value_standard", r.Header.Get("Header-Lowercase"))
 }
 
+func TestSetHeaderMultipleValue(t *testing.T) {
+	ts := createPostServer(t)
+	defer ts.Close()
+
+	r := dclr().
+		SetHeaderMultiValues(map[string][]string{
+			"Content":       []string{"text/*", "text/html", "*"},
+			"Authorization": []string{"Bearer xyz"},
+		})
+	assertEqual(t, "text/*, text/html, *", r.Header.Get("content"))
+	assertEqual(t, "Bearer xyz", r.Header.Get("authorization"))
+}
+
 func TestOutputFileWithBaseDirAndRelativePath(t *testing.T) {
 	ts := createGetServer(t)
 	defer ts.Close()