resty
resty copied to clipboard
set Content-Type to be empty
The Content-Type
header maybe a part of oauth signed request.
https://github.com/go-resty/resty/blob/7dda6159eceee10c6cacc6f9d1637042f67423b0/middleware.go#L430-L436
One using resty might have to use PreRequestHook
to make a request with empty content type.
resty.New().SetPreRequestHook(func(client *resty.Client, request *http.Request) error {
request.Header.Set("Content-Type", "") // set empty string
request.Header.Set("Request-Signature", makeSignature(
privateKey, strings.Join(getPathURL(request), request.Header["Content-Type"], getTimeString())))
return nil
})