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

possibility to provide a config option so that url don't get encoded in http adapter #4071

Open
ymurong opened this issue Sep 17, 2021 · 0 comments

Comments

@ymurong
Copy link

ymurong commented Sep 17, 2021

Is your feature request related to a problem? Please describe.

When we consume OData APIs using Axios, we always run into problems as Axios will always encode the URL while a typical odata resource would contain specials characters such as (, ) etc....

After analyzing the source code, we found that it will always parse the URL and use the parsed result before sending the request.

var parsed = url.parse(fullPath);

https://github.com/axios/axios/blob/v0.21.4/lib/adapters/http.js#L98

var options = {
    path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
    method: config.method.toUpperCase(),
    headers: headers,
    agent: agent,
    agents: { http: config.httpAgent, https: config.httpsAgent },
    auth: auth
  };

https://github.com/axios/axios/blob/v0.21.4/lib/adapters/http.js#L116

Describe the solution you'd like

Would it be possible to provide a config option so that Axios could send the original URL without encoding it?

Describe alternatives you've considered

N/A

Additional context

we could propose a merge request if you would like to take into account this kind of feature.

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

2 participants