opal-jquery icon indicating copy to clipboard operation
opal-jquery copied to clipboard

Add setting to prevent payload automatic processing

Open elmendalerenda opened this issue 6 years ago • 1 comments

I was trying to send a multipart payload, but since the current code is processing everything that is not a string as json, I couldn't make through. This PR uses the flag processData for the same purpose that is used in jquery ajax. In my case, I use it together with contentType: false to send a FormData:

payload = Native(%x{new FormData(#{form.get(0)})})
options = {payload: payload, contentType: false, processData: false}
HTTP.post url, options do |response|
...
end

elmendalerenda avatar Sep 11 '19 04:09 elmendalerenda

I agree we should find a way to have the method to be more transparent to jQuery so that we can minimize the necessity to backport every feature from it.

I restarted the build to see if it passes, but I think I need to update the Travis config first.

elia avatar Sep 19 '19 21:09 elia