Skip to content

"Subnet Id must be numeric" - post request #3177

Closed
@default-u

Description

@default-u

hi.
my code on python not work:

phpipam_headers = {'token': 'xxxx', 'Content-Type': 'application/json'}
ipam_post_data = {"subnetId": "52", "ip": "1.1.1.1", "hostname": "testhost-from-api"}
ipam_r = requests.post('https://ipam/api/appname/addresses/', data=ipam_post_data, headers=phpipam_headers)

in response i see:

{
"code": 400,
"message": "Subnet Id must be numeric",
"success": false,
"time": 0.015
}

also curl not working:
curl -X POST -s --header 'Content-Type: application/json' --header 'token: xxxxxxxx' --data {"subnetId": "52", "ip": "1.1.1.1", "hostname": "testhost-from-api"} https://ipam/api/appname/addresses/

curl response:
{"code":400,"success":false,"message":"Subnet Id must be numeric","time":0.012}

i not understand, where is my trouble?

my phpipam version - 1.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions