This is a migrated thread and some comments may be shown as answers.

How to cancel sending request with OPTION http method?

1 Answer 161 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Bartlomiej
Top achievements
Rank 1
Bartlomiej asked on 02 Oct 2018, 11:15 AM
I want to avoid sending request with OPTION http method. With below configuration Kendo sending two requests, first with OPTION method that sending nothing and right after with POST method with file data.
$("#fileupload").kendoUpload({
  async: {
    saveUrl: API_URL+'...',
    withCredentials: false,
    autoUpload: false,
  },
  uploadEventHandler (e) {
    e.headers.set('Access-Control-Allow-Credentials', 'true');
  },
  type: "post",
  error: function (e) {
    var files = e.files;
    if (e.operation === "upload") {
      ...
    }
  },
  upload: function (d) {
    d.data = {
    ...
    };
  },
  showFileList: true,
})

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 04 Oct 2018, 06:56 AM
Hello,

Options http request is a common issue that is observed by all cross origin requests and is not specific for Kendo Upload. You can refer to this forum thread where more information about it is provided and possible ways to disable it are added. In Kendo Upload you can use the upload event to add custom headers as it is described here at the bottom of the page.

Regards,
Plamen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Upload
Asked by
Bartlomiej
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or