LoginSignup
4
2

More than 3 years have passed since last update.

IE11 > axios > POSTのつもりがうまく送れてないとき

Last updated at Posted at 2019-01-30

OPTIONSで送信している事がある。

axiosでPOST


  // Send a POST request
  const params = new URLSearchParams();
  params.append("bbb", "aaa");
  params.append("xxx", "yyy");

  return axios
    .post(fullUrl, params)
    .then(response => {
      const result = response;
      return { result }; 
    })
    .catch(err => {
      return { err };
    });
}

url-search-params-polyfill

URLSearchParamsはIE11でつかえないので、URLSearchParamsの polyfill を使う

yarn add url-search-params-polyfill


jerrybendy/url-search-params-polyfill: a simple polyfill for javascript URLSearchParams

↓同様のpolyfillは動作しなかった
ungap/url-search-params: The URLSearchParams polyfill

↓はオワコン
WebReflection/url-search-params: Simple polyfill for URLSearchParams standard

参考

axiosでPOSTでRequestしているつもりがOPTIONSで送信している - Qiita

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2