Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmRequest 在传输 formdata 时不应设置 content-type #20

Closed
dragonwong opened this issue Jan 22, 2015 · 1 comment
Closed

mmRequest 在传输 formdata 时不应设置 content-type #20

dragonwong opened this issue Jan 22, 2015 · 1 comment

Comments

@dragonwong
Copy link
Contributor

No description provided.

dragonwong added a commit to dragonwong/mmRequest that referenced this issue Jan 22, 2015
@dragonwong
Copy link
Contributor Author

已修正,在判断传输数据为 FormData 对象时,将不设置 content-type。同时,avalon.ajax 传输 FormData 对应的 api 也有变化:

  1. 取消对 contentType 的设置;
  2. data 对应附加的数据,form 对应 FormData 对象。

avalon.ajax 传输 FormData 对应的新的 api 如下:

avalon.ajax({
    form: formData, // formData 对象
    data: data, // 附加的内容,它会在传输前添加进 formData 中
    type: "post",
    url: url,
    success: callback,
    dataType: dataType
})

avalon.upload 的 api 无变化。

RubyLouvre added a commit that referenced this issue Jan 23, 2015
fix set content-type bug when send formdata #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant