Project

General

Profile

axios with redmine

Added by abir bn almost 6 years ago

Hello, I m using axios to consume redmine api, the get request worked for me but i failed to make a post or delete request ( error:Response for preflight has invalid HTTP status code 404), does anyone have an example ? this is my example, i m trying to delete the project with 1 id

export default {
xport default {
name: 'HelloWorld',
data () {
return {
project: {}
}
},
created () {
axios.defaults.headers.common['Authorization'] = 'xxxxxxxxxxxxx';
axios.delete('http://localhost/redmine/projects/[1].xml')
.then(response => {
console.log(response)
this.project = response.data
})
.catch(err => {
console.log(err)
})
}
}