Change Method #970

Open
opened 2018-01-26 15:30:24 +00:00 by fzunigad · 4 comments
fzunigad commented 2018-01-26 15:30:24 +00:00 (Migrated from github.com)

this uploader = new FileUploader({
url: URL,
method: "POST",
headers: [
{ name: "Content-Type", value: "multipart/form-data" },
{ name: "Authorization", value: "Bearer " + user.accessToken }
]
});

After doing this it doesn't change the Method it just sends as "OPTIONS" and I need "POST"

this uploader = new FileUploader({ url: URL, method: "POST", headers: [ { name: "Content-Type", value: "multipart/form-data" }, { name: "Authorization", value: "Bearer " + user.accessToken } ] }); After doing this it doesn't change the Method it just sends as "OPTIONS" and I need "POST"
elizabethfernandez commented 2018-06-28 14:52:21 +00:00 (Migrated from github.com)

Hi! I'm having the same issue, were you able to figure it out?

Hi! I'm having the same issue, were you able to figure it out?
fzunigad commented 2018-06-28 15:11:46 +00:00 (Migrated from github.com)

Yup, at the end it was a CORS problem. It sends an OPTIONS but after that it sends the POST. so if you haven't set CORS headers on your server it will fail right after the OPTIONS call.

Yup, at the end it was a CORS problem. It sends an OPTIONS but after that it sends the POST. so if you haven't set CORS headers on your server it will fail right after the OPTIONS call.
elizabethfernandez commented 2018-06-28 16:22:14 +00:00 (Migrated from github.com)

Thanks! I'm kind of new to this and I'm not familiar with CORS, can you share your solution? I have a Spring boot back-end application

Thanks! I'm kind of new to this and I'm not familiar with CORS, can you share your solution? I have a Spring boot back-end application
kojilab commented 2020-02-17 20:58:38 +00:00 (Migrated from github.com)

Running into the same issue. POST becomes a GET. No CORS for me

Running into the same issue. POST becomes a GET. No CORS for me
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#970