Goldziher / axios-simple-cache-adapter

Configurable axios cache adapter for node and the browser
https://www.npmjs.com/package/axios-simple-cache-adapter
MIT License
11 stars 5 forks source link

Using the cache adapter changes requests #26

Open ghost23 opened 4 months ago

ghost23 commented 4 months ago

I am doing this request:

import formurlencoded from 'form-urlencoded';

// ...

const response = await myAxios.request<UserResponse>({
   method: 'post',
   url: 'login',
   data: formurlencoded(user),
   headers: {
     'Content-Type': 'application/x-www-form-urlencoded'
   }
});

If I am doing this without your adapter the browser sends a request with a form paylod.

If I am using your adapter, the Content-Type ist changed to: "application/xml;charset=UTF-8" and the data is send as request parameters.

Goldziher commented 4 months ago

Hi @ghost23. Thanks for reporting this issue. PRs are welcome.