Y
Y
yativ_sobb2017-08-01 20:52:50
JavaScript
yativ_sobb, 2017-08-01 20:52:50

Preflight not working on put request?

I send a put request using axios, but it says options to me, even though I set "preflight".

this.url.defaults.transformRequest = [(data) =>  JSON.stringify(data)]
 
        return this.url.put('/index.php/rest/' + type + '/signin',{
            number
        })

I did the same thing with post, but "preflight" worked for post
return this.url.post('/index.php/rest/' + post.type + '/signup',{
                "number" : post.number,
                "name" : post.name,
                "city_id" : post.city_id,
            })

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Shashenkov, 2017-08-01
@teknik2008

If this is a cross-domain request, then you must first process OPTIONS, and then accept POST
Here it is described in detail

Y
yativ_sobb, 2017-08-02
@yativ_sobb

OOO, I found what the problem is, it turns out that the server side forbade the put request

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question