Hi, I am trying to create a new device through an http request, I attach the code that I use to assign variables to an already created device
//Dart code on flutter–Post method to send a data
String url =
‘http://industrial.api.ubidots.com/api/v1.6/devices/DEVICE_LABEL/’;
String body = ‘{“Variable_Label”: “Data”}’; // Body of Post
int length = body.length;
Map<String, String> headers = { //Header of Post
“X-Auth-Token”: “Auth_Token”,
“Content-Type”: “application/json”,
“Content-Length”: “$length”,
};
Response response = await post(url,headers: headers, body: body); Send Post Request
print(response.statusCode);
How could I adapt it to create a new device instead of sending a variable? Thanks