Perhaps it is good to use the right path for api? Idiot.
This commit is contained in:
parent
53d15e76f4
commit
491acef347
1 changed files with 2 additions and 2 deletions
|
@ -96,13 +96,13 @@ func (i *Dcim_Interfaces_Create) CreateInterface(n *NetBox) error {
|
||||||
Transport: transport,
|
Transport: transport,
|
||||||
}
|
}
|
||||||
fmt.Println(bytes.NewBuffer(interfaceData))
|
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 {
|
if err != nil {
|
||||||
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("Content-Type", "application/json")
|
||||||
request.Header.Add("Authorization", "Token "+n.Token)
|
request.Header.Add("Authorization", " Token "+n.Token)
|
||||||
fmt.Println(request.Header)
|
fmt.Println(request.Header)
|
||||||
response, err := client.Do(request)
|
response, err := client.Do(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue