Forum Discussion

rliu_330156's avatar
rliu_330156
Icon for Nimbostratus rankNimbostratus
Aug 15, 2017

Get error when sending JSON formatted data to the device

Hi,

 

I have gone after the instruction on 'iControl REST 101 – Creating Objects' to run:

 

curl -sk -u admin:production https://10.183.54.20/mgmt/tm/net/self/ -H 'Content-Type: application/json' -X POST -d '{"name":"cw_test2","address":"10.10.10.3/8","vlan":"internal"}'

 

and I got error message return as:

 

{"code":415,"message":"Found invalid content-type. The content-type must be application/json. The received content-type is application/x-www-form-urlencoded","errorStack":[],"apiError":1}

 

Can you let me know the possible reason to cause it?

 

3 Replies

  • Madhu_Rajagopa1's avatar
    Madhu_Rajagopa1
    Historic F5 Account

    I was successful in creating a self IP with the given curl command. I copied your curl command and tried after changing the management IP on my v12.1.2.

     

    Are you sure you are not missing the -H option when attempting this? I get that error when I don't include the -H option.

     

    What version are you trying this on?