adicionar_http(){
let data = JSON.stringify({
name : this.name,
uniqueId: this.imei_serial,
groupid : this.groupo,
phone : this.phone,
category: this.modelo,
model : this.contato,
contact : this.placa,
attributes: {},
disabled : 'false',
photo : '',
})
let headers = {
headers: {
'Content-Type': 'application/json',
'Accept' : 'application/json',
'Authorization': 'Basic '+this.$store.getters.getToken,
'Connection' : 'Keep-Alive',
'Access-Control-Allow-Origin': '*'
},
proxy: {
host: this.url[0]+this.url[1],
port: this.url[2]
}
}
this.$http.post(
this.$store.getters.getHost+'/api/devices',
headers,
data
)
.then( response => {
console.log(response)
})
}
adicionar_http(){ let data = JSON.stringify({ name : this.name, uniqueId: this.imei_serial, groupid : this.groupo, phone : this.phone, category: this.modelo, model : this.contato, contact : this.placa, attributes: {}, disabled : 'false', photo : '', // chassi: 'chassi', //renavam: 'renavam', //placa: 'placa' }) let headers = { headers: { //Authorization: 'Bearer ' + token //the token is a variable which holds the token //'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/json', 'Accept' : 'application/json', 'Authorization': 'Basic '+this.$store.getters.getToken, 'Connection' : 'Keep-Alive', 'Access-Control-Allow-Origin': '*' }, proxy: { host: this.url[0]+this.url[1], port: this.url[2] } } this.$http.post( this.$store.getters.getHost+'/api/devices', headers, data ) .then( response => { console.log(response) }) }