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

How do I preserve header name case? #809

Closed
rew1nter opened this issue Aug 3, 2024 · 1 comment
Closed

How do I preserve header name case? #809

rew1nter opened this issue Aug 3, 2024 · 1 comment
Assignees
Labels

Comments

@rew1nter
Copy link

rew1nter commented Aug 3, 2024

So far this returns an error

	c := resty.New().
		SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})

	req := c.R()
	// req.SetHeader("star", "wars")
	req.RawRequest.Header["star"] = []string{"wars"}
	res, err := req.
		Get("http://rey.gg")
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Status())
@jeevatkm jeevatkm self-assigned this Aug 4, 2024
@jeevatkm
Copy link
Member

jeevatkm commented Aug 4, 2024

@rew1nter You can use these methods

https://pkg.go.dev/github.com/go-resty/resty/v2#Client.SetHeaderVerbatim

https://pkg.go.dev/github.com/go-resty/resty/v2#Request.SetHeaderVerbatim

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

No branches or pull requests

2 participants