fix auth.

This commit is contained in:
Kalle Carlbark 2019-09-11 09:59:24 +02:00
parent bbed21d42b
commit 53d15e76f4
No known key found for this signature in database
GPG key ID: 3FC0C93C5A5A0670

View file

@ -101,7 +101,9 @@ func (i *Dcim_Interfaces_Create) CreateInterface(n *NetBox) error {
return err return err
} }
request.Header.Add("Accept", "application/json") request.Header.Add("Accept", "application/json")
request.Header.Add("Content-Type", "application/json")
request.Header.Add("Authorization", "Token "+n.Token) request.Header.Add("Authorization", "Token "+n.Token)
fmt.Println(request.Header)
response, err := client.Do(request) response, err := client.Do(request)
if err != nil { if err != nil {
return err return err