Community discussions

MikroTik App
 
lechat75
just joined
Topic Author
Posts: 6
Joined: Sun Jun 21, 2020 12:24 pm

API REST syntax

Sun Feb 21, 2021 7:33 pm

Hello,
Thank MT for the REST API !
I was wondering what's wrong with the following syntax :

curl -k -u admin: -X POST https://192.168.160.50/rest/system/identity/set --data '{"name":"Lab001"}' -H "content-type:application/json"

{"detail":"Invalid JSON","error":400,"message":"Bad Request"}

I get the same results with Postman or from the requests Python library.
There is no big deal with authentication or certificate.
-X GET is working fine.

Thanks for help !
Emmanuel

Who is online

Users browsing this forum: nannou9 and 7 guests