Article From:

I want to make a request with Axios, but the following is the wrong report, No’Access-Control-Allow-Origin’header is present on the requested resource. ORigin’http://localhost:8085’is therefore not allowed access. The response had HTTP had 405.
Then I used the jQuery method to ask for a time, not to make a mistake, do not understand why the Axios request is wrong, because it is based on the Vue environment, so it is the first attempt to use the Axios request, hope the passing of the gods to point out a little

      method: 'get',
      url: '',
      responseType: 'json',
      data: PostJson({
                    fitUserId: 'belle',
                    reqTransfer: '/apifit/medal/getUser'
    .then(function (response) {
    .catch(function (error) {

Answer 0:

405It’s a request type error. Let’s see if the backend does not support the get request.

Answer 1:

No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Cross domain request error, to the back end to respond to the headAccess-Control-Allow-OriginSet up*Just fine

Link of this Article: Axios request error 405

Leave a Reply

Your email address will not be published. Required fields are marked *