feat: set up project
This commit is contained in:
16
kit/http.go
Normal file
16
kit/http.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user