btc-pay-checker/kit/http.go

17 lines
310 B
Go
Raw Normal View History

2023-07-19 11:47:46 +02:00
package kit
import "net/http"
const JsonHeader = "application/json"
func WithJSONHeaders(r *http.Request) {
r.Header.Add("Accept", JsonHeader)
r.Header.Add("Content-Type", JsonHeader)
}
func WithHeaders(r *http.Request, headers map[string]string) {
for k, v := range headers {
r.Header.Add(k, v)
}
}