Perhaps it is good to use the right path for api? Idiot.

This commit is contained in:
Kalle Carlbark 2019-09-11 10:03:06 +02:00
parent 53d15e76f4
commit 491acef347
No known key found for this signature in database
GPG key ID: 3FC0C93C5A5A0670

View file

@ -96,13 +96,13 @@ func (i *Dcim_Interfaces_Create) CreateInterface(n *NetBox) error {
Transport: transport,
}
fmt.Println(bytes.NewBuffer(interfaceData))
request, err := http.NewRequest("POST", n.RootURL+"/dcim/interfaces/", bytes.NewBuffer(interfaceData))
request, err := http.NewRequest("POST", n.RootURL+"/api/dcim/interfaces/", bytes.NewBuffer(interfaceData))
if err != nil {
return err
}
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)
if err != nil {